Esempio n. 1
0
    public void addLine(List <GameObject> lineRenderers, List <Vector3> linePoints, int numOfPoints)
    {
        LineDescription lineDescription = new LineDescription(lineRenderers, linePoints, numOfPoints);

        lineDescriptions.Add(lineDescription);
        hash += 1;
    }
Esempio n. 2
0
        private static Line CreateLine(GraphicsDevice device, Vector3 position, LineDescription edge, Color color)
        {
            var line = new Line(device, color, edge.A, edge.B)
            {
                Position = position
            };

            line.Update();

            return(line);
        }
Esempio n. 3
0
        private LineDescription FindBestLine()
        {
            LineDescription best = new LineDescription();

            foreach (var c in Counters)
            {
                var d      = Direction.Single;
                int length = c.LineLength(d, Game.Board);
                if (length > best.Length)
                {
                    best.Length       = length;
                    best.StartCounter = c;
                    best.Direction    = d;
                }
            }

            return(best);
        }
Esempio n. 4
0
        private List <int> PossibleNextMoves(LineDescription line)
        {
            var moves = new List <int>();

            switch (line.Direction)
            {
            case Direction.Down:
                moves.Add(line.StartCounter.Left);
                break;

            case Direction.Right | Direction.LeftDown | Direction.RightDown:
                moves.Add(line.StartCounter.Left - line.Length);
                moves.Add(line.StartCounter.Left + 1);
                break;
            }

            return(moves);
        }
Esempio n. 5
0
 //display details for line
 private string DisplayLineDescription(LineDescription line)
 {
     return(String.Format("{0}, \n\t\t{1}, \n\t\t{2}", line.LongName, line.Mode, line.Color));
 }
Esempio n. 6
0
        private string DisplayLineDescription(string line)
        {
            LineDescription lineDescription = GetLineDescription(line);

            return(String.Format("{0}, \n\t\t{1}", lineDescription.LongName, lineDescription.Mode));
        }