Exemple #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);
        }
Exemple #2
0
        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);
        }
Exemple #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;
        }
Exemple #4
0
 private TileTerrain InitTerrain(char c)
 {
     return(TileTerrain.Parse(c));
 }
Exemple #5
0
 public Tile(int x, int y, TileTerrain t, List <TileObject> obj) : this(new Location(y, x), t, obj)
 {
 }