Exemple #1
0
        public static int GetID(Tile t)
        {
            if (t == null) return -1;

            for (int i = 0; i < MaxTiles; i++)
                if (_tiles[i] != null && t.GetType() == _tiles[i].GetType() &&
                    t.TileName == _tiles[i].TileName && t.TexturePosition == _tiles[i].TexturePosition) return i;
            return -1;
        }
Exemple #2
0
 public static void AddTile(Tile t, int id)
 {
     if (_tiles[id] == null)
         _tiles[id] = t;
 }
Exemple #3
0
 public static Rectangle GetSpriteRectangle(Tile tile)
 {
     return GetSpriteRectangle((int)tile.TexturePosition.X, (int)tile.TexturePosition.Y);
 }