示例#1
0
 public XmlBoard(ListArrayOfT hexes)
 {
     _Hexes = new ListArrayOfT(hexes.Width, hexes.Height);
     foreach (Hex h in hexes)
         _Hexes.Add(h);
 }
示例#2
0
        /// <summary>
        /// Creates a new board with specified height and width
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        public XmlBoard(int width, int height)
            : this()
        {
            _Width = width;
            _Height = height;
            _Hexes = new ListArrayOfT(width, height);

            // Default empty board is filled with seahexes
            for (int h = 0; h < height; h++)
                for (int w = 0; w < width; w++)
                    _Hexes.Add(new SeaHex() { Location = new HexLocation() { W = w, H = h } });
        }