54 lines
1.2 KiB
C#
54 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
namespace DongWuYiXue.DaoNiaoShu
|
|
{
|
|
public class Line : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public List<Point> points;
|
|
|
|
public bool IsTrue()
|
|
{
|
|
return false;
|
|
}
|
|
public void AddPoint(Point point)
|
|
{
|
|
if (points == null) points = new();
|
|
points.Add(point);
|
|
}
|
|
public bool ContainsAll(List<Point> points)
|
|
{
|
|
return points.SequenceEqual(points);
|
|
}
|
|
public bool Contains(Point point)
|
|
{
|
|
return points.Contains(point);
|
|
}
|
|
|
|
public void Error()
|
|
{
|
|
GetComponent<Image>().color = Color.red;
|
|
}
|
|
|
|
public void Correct()
|
|
{
|
|
GetComponent<Image>().color = Color.green;
|
|
}
|
|
public bool Judge()
|
|
{
|
|
if (points[0].answers.Contains(points[1]))
|
|
{
|
|
return true;
|
|
}
|
|
if (points[1].answers.Contains(points[0]))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|