Exemplo n.º 1
0
        public Tile MakeTile(int x, int y, string s)
        {
            TileTerrain t    = InitTerrain(char.ToUpper(s[0]));
            TileObject  obj  = InitObject(s, new Vector2i(x, y));
            var         tile = new Tile(x, y, t, obj);

            //tile.tileObject.Remove += (o) => tile.tileObject = null;
            return(tile);
        }
Exemplo n.º 2
0
Arquivo: Map.cs Projeto: FortTell/homm
        public Tile MakeTile(int x, int y, string s)
        {
            TileTerrain t    = InitTerrain(char.ToUpper(s[0]));
            TileObject  obj  = InitObject(s, new Location(y, x));
            var         tile = new Tile(x, y, t, obj);

            if (tile.tileObject != null)
            {
                tile.tileObject.Remove += (o) => tile.tileObject = null;
            }
            return(tile);
        }
Exemplo n.º 3
0
        public Tile(Location location, TileTerrain t, List <TileObject> objects)
        {
            Location = location;
            Terrain  = t;

            foreach (var obj in objects)
            {
                obj.Remove += o => objects.Remove(o);
            }

            this.objects = objects;
        }
Exemplo n.º 4
0
 private TileTerrain InitTerrain(char c)
 {
     return(TileTerrain.Parse(c));
 }
Exemplo n.º 5
0
 public Tile(int x, int y, TileTerrain t, List <TileObject> obj) : this(new Location(y, x), t, obj)
 {
 }