public void AddIfNotExist(MapSprite.Type type, char sprite) { if (!IsExist(type)) { Add(type, sprite); } }
public MapSprite this[MapSprite.Type type] { get { try { return(this.mapSprites.Find(sprite => sprite.Is(type))); } catch { return(UnknownSprite); } } }
public bool IsExist(MapSprite.Type type) { MapSprite sprite = this[type]; if (sprite == null) { return(false); } return(sprite.Is(type)); }
public int GetID(MapSprite.Type type) => GetID(s => s.Is(type));
public List <int> GetIDs(MapSprite.Type type) { try { return(this.mapSprites.Indexed().Where(t => t.item.Is(type)).Select(t => t.index).ToList()); } catch { return(new List <int>()); } }
public void Add(MapSprite.Type type, char sprite) => Add(new MapSprite(type, sprite));