Example #1
0
 public BoardUI(Logic.Board board, double width, double height, double x, double y)
     : base((int)width, (int)height, (int)x, (int)y)
 {
     Width  = (int)width;
     Height = (int)height;
     Board  = board;
 }
Example #2
0
 public BoardUI(Logic.Board board, double width, double height, double x, double y)
     : base((int)width, (int)height, (int)x, (int)y)
 {
     Width = (int)width;
     Height = (int)height;
     Board = board;
 }
Example #3
0
 /// <summary>
 /// BoardUI setup. Details in the param descriptions.
 /// </summary>
 /// <param name="board">Used to calculate the width of the BoardUI</param>
 /// <param name="width">This is the space permitted for this board to take up</param>
 /// <param name="height">Same as width but for this dimension</param>
 /// <param name="x">The x coord for the top left location of this view on the screen</param>
 /// <param name="y">The same as x but for the vertical location</param>
 public BoardUI(Logic.Board board, double width, double height, double x, double y)
     : base((int)width, (int)height, (int)x, (int)y)
 {
     Width = (int)width+1;
     Height = (int)height;
     Board = board;
     this.squareSize = (int)Math.Min(Width/board.Width, Height/board.Height);
 }
Example #4
0
 /// <summary>
 /// BoardUI setup. Details in the param descriptions.
 /// </summary>
 /// <param name="board">Used to calculate the width of the BoardUI</param>
 /// <param name="width">This is the space permitted for this board to take up</param>
 /// <param name="height">Same as width but for this dimension</param>
 /// <param name="x">The x coord for the top left location of this view on the screen</param>
 /// <param name="y">The same as x but for the vertical location</param>
 public BoardUI(Logic.Board board, double width, double height, double x, double y)
     : base((int)width, (int)height, (int)x, (int)y)
 {
     Width           = (int)width + 1;
     Height          = (int)height;
     Board           = board;
     this.squareSize = (int)Math.Min(Width / board.Width, Height / board.Height);
 }
Example #5
0
        public WallSprite(Element e, String path, double size, Board board)
            : base(e, size)
        {
            b = board;
            int ex = (int)e.X;
            int ey = (int)e.Y;
            int X = b.Width;
            int Y = b.Height;
            Element[,] c = new Element[X, Y];
            foreach (Element el in b.Elements)
            {
                int x1 = (int)el.X;
                int y1 = (int)el.Y;
                c[x1, y1] = el;

            }
            Path = wallpath(c,ex, ey);
        }
Example #6
0
        public WallSprite(Element e, String path, double size, Board board)
            : base(e, size)
        {
            b = board;
            int ex = (int)e.X;
            int ey = (int)e.Y;
            int X  = b.Width;
            int Y  = b.Height;

            Element[,] c = new Element[X, Y];
            foreach (Element el in b.Elements)
            {
                int x1 = (int)el.X;
                int y1 = (int)el.Y;
                c[x1, y1] = el;
            }
            Path = wallpath(c, ex, ey);
        }
Example #7
0
        public AbstactBot CreatBot(string nameBotType, Logic.Board board, Logic.Player player)
        {
            if (board == null)
            {
                throw new ArgumentNullException("board");
            }
            if (player == null)
            {
                throw new ArgumentNullException("player");
            }

            if (listBotTypes.Exists(bt => bt.Name == nameBotType))
            {
                return((TicTacToe.Bots.AbstactBot)Activator.CreateInstance(listBotTypes.First(bt => bt.Name == nameBotType), new object[] { player, board }));
            }
            else
            {
                throw new ArgumentException("can't find bot of type " + nameBotType, "nameBotType");
            }
        }
Example #8
0
 public ScoreView(Logic.Board board, double width, double height, double x, double y)
     : base(width, height, x, y)
 {
 }
Example #9
0
 public InPlay(Logic.Board board, double width, double height, double x, double y)
     : base(width, height, x, y)
 {
 }
Example #10
0
 public BoardUI(Logic.Board board)
 {
     Sprites.Add(new SpriteDemo());
 }