public EquipmentPresenter(EEquipmentPlaces _place, Item _item, ConsoleKey _key, char _c) { Place = _place; Item = _item; Key = _key; C = _c; }
/// <summary> /// Добавить в рюкзак и затем экипироваться /// </summary> /// <param name = "_place"></param> /// <param name = "_item"></param> protected void Equip(EEquipmentPlaces _place, Item _item) { if (_item is FakedItem) { _item = (Item)((FakedItem)_item).Essence.Clone(this); } //_item.Resolve(this); ObjectTaken(_item); TakeOn(_place, _item); }
public void TakeOff(EEquipmentPlaces _place) { var item = m_equipment[_place]; if (item == null) { throw new ApplicationException("Чего снять?"); } m_equipment[_place] = null; m_backPack.GetItems(this).Add(item); }
public Noun AsNoun(EEquipmentPlaces _e) { switch (_e) { case EEquipmentPlaces.HEAD: return("Голова".AsNoun(ESex.FEMALE, false)); case EEquipmentPlaces.NECK: return("Шея".AsNoun(ESex.FEMALE, false)); case EEquipmentPlaces.BODY: return("Тело".AsNoun(ESex.IT, false)); case EEquipmentPlaces.GIRGLE: return("Пояс".AsNoun(ESex.MALE, false)); case EEquipmentPlaces.CLOACK: return("Накидка".AsNoun(ESex.FEMALE, false)); case EEquipmentPlaces.RIGHT_HAND: return("рука".AsNoun(ESex.FEMALE, false) + "Правый".AsAdj()); case EEquipmentPlaces.LEFT_HAND: return("рука".AsNoun(ESex.FEMALE, false) + "Левый".AsAdj()); case EEquipmentPlaces.RIGHT_RING: return("Кольцо".AsNoun(ESex.IT, false) + "на правой руке".AsIm()); case EEquipmentPlaces.LEFT_RING: return("Кольцо".AsNoun(ESex.IT, false) + "на левой руке".AsIm()); case EEquipmentPlaces.BRACERS: return("Наручи".AsNoun(ESex.PLURAL, false)); case EEquipmentPlaces.GAUNTLETS: return("Перчатки".AsNoun(ESex.PLURAL, false)); case EEquipmentPlaces.BOOTS: return("Обувь".AsNoun(ESex.FEMALE, false)); case EEquipmentPlaces.MISSILE_WEAPON: return("оружие".AsNoun(ESex.IT, false) + "Метательный".AsAdj()); case EEquipmentPlaces.MISSILES: return("Снаряды".AsNoun(ESex.PLURAL, false)); case EEquipmentPlaces.TOOL: return("Инструмент".AsNoun(ESex.MALE, false)); default: throw new ArgumentOutOfRangeException("_e"); } }
public void TakeOn(EEquipmentPlaces _place, Item _item) { var equipmentPlacesAttribute = EquipmentPlacesAttribute.GetAttribute(_place); if (!equipmentPlacesAttribute.IsAbleToEquip(_item.Category)) { throw new ApplicationException("Нельзя экипировать '" + _item.GetName(this) + "' как '" + EALSentence.NONE.GetString(_place.AsNoun()) + "'"); } var item = m_equipment[_place]; if (item != null) { throw new ApplicationException("Одно поверх другого?"); } m_backPack.GetItems(this).Remove(_item); m_equipment[_place] = _item; }
public Noun AsNoun(EEquipmentPlaces _e) { switch (_e) { case EEquipmentPlaces.HEAD: return "Голова".AsNoun(ESex.FEMALE, false); case EEquipmentPlaces.NECK: return "Шея".AsNoun(ESex.FEMALE, false); case EEquipmentPlaces.BODY: return "Тело".AsNoun(ESex.IT, false); case EEquipmentPlaces.GIRGLE: return "Пояс".AsNoun(ESex.MALE, false); case EEquipmentPlaces.CLOACK: return "Накидка".AsNoun(ESex.FEMALE, false); case EEquipmentPlaces.RIGHT_HAND: return "рука".AsNoun(ESex.FEMALE, false) + "Правый".AsAdj(); case EEquipmentPlaces.LEFT_HAND: return "рука".AsNoun(ESex.FEMALE, false) + "Левый".AsAdj(); case EEquipmentPlaces.RIGHT_RING: return "Кольцо".AsNoun(ESex.IT, false) + "на правой руке".AsIm(); case EEquipmentPlaces.LEFT_RING: return "Кольцо".AsNoun(ESex.IT, false) + "на левой руке".AsIm(); case EEquipmentPlaces.BRACERS: return "Наручи".AsNoun(ESex.PLURAL, false); case EEquipmentPlaces.GAUNTLETS: return "Перчатки".AsNoun(ESex.PLURAL, false); case EEquipmentPlaces.BOOTS: return "Обувь".AsNoun(ESex.FEMALE, false); case EEquipmentPlaces.MISSILE_WEAPON: return "оружие".AsNoun(ESex.IT, false) + "Метательный".AsAdj(); case EEquipmentPlaces.MISSILES: return "Снаряды".AsNoun(ESex.PLURAL, false); case EEquipmentPlaces.TOOL: return "Инструмент".AsNoun(ESex.MALE, false); default: throw new ArgumentOutOfRangeException("_e"); } }
public static Noun AsNoun(this EEquipmentPlaces _place) { return(World.AL.AsNoun(_place)); }
public static EquipmentPlacesAttribute GetAttribute(EEquipmentPlaces _enum) { return(Attrs[_enum]); }
public Item this[EEquipmentPlaces _places] { get { return m_equipment[_places]; } }
public Item this[EEquipmentPlaces _places] { get { return(m_equipment[_places]); } }
public static EquipmentPlacesAttribute GetAttribute(EEquipmentPlaces _enum) { return Attrs[_enum]; }