Exemple #1
0
 public GUITile(int x, int y, Tile tile, bool omit)
     : base(new Vector2((float) ((x+0.5+(y % 2 == 0 ? 0.5 : 0))*TileWidth()), (float) ((0.66+y)*TileShift())),
         GetTexture(tile.Terrain))
 {
     Tile = tile;
     Omitted = omit;
     NumAreaAndTextPos();
     valueColour = (Tile.Value == 6 || Tile.Value == 8 ? Color.Red : Color.Black);
 }
Exemple #2
0
        private Board(Tile[][] terrain, Dictionary<Edge, int> roads,
            Dictionary<Intersection, Piece> settlements, int robber,
            Harbor[] harbors, Intersection[] inter, Edge[] edges)
            : this()
        {
            this.allEdges = edges;
            this.allIntersections = inter;

            this.terrain = terrain;
            this.roads = roads;
            this.settlements = settlements;
            this.robberLocation = robber;
            this.harbors = harbors;
        }
Exemple #3
0
        private Board()
        {
            // initialize fields
            roads = new Dictionary<Edge, int>(22);
            settlements = new Dictionary<Intersection, Piece>(22);
            harbors = new Harbor[9];

            // create board
            terrain = new Tile[7][];
            bool longrow = false;
            for (int i = 0; i < 7; i++)
            {
                terrain[i] = new Tile[longrow ? 7 : 6];
                longrow = !longrow;
            }

            // place water
            foreach (int water in WaterTiles)
            {
                Tuple<int, int> coords = GetTerrainCoords(water);
                terrain[coords.Item1][coords.Item2] = new Tile(Terrain.Water, 0);
            }
        }
Exemple #4
0
 private static bool IsTileNumbered(Tile tile)
 {
     switch (tile.Terrain)
     {
         case Terrain.Pasture:
         case Terrain.Mountains:
         case Terrain.Hills:
         case Terrain.Fields:
         case Terrain.Forest:
             return true;
         default:
             return false;
     }
     //
 }