Пример #1
0
 public virtual bool Register <T>(T module)
 {
     if (module is IInit)
     {
         IInit v = (IInit)module;
         v.Init();
     }
     if (module is IUpdate)
     {
         IUpdate v = (IUpdate)module;
         if (!m_UpdateList.Contains(v))
         {
             m_UpdateList.Add(v);
         }
     }
     if (module is IDestroy)
     {
         IDestroy v = (IDestroy)module;
         if (!m_DestroyList.Contains(v))
         {
             m_DestroyList.Add(v);
         }
     }
     return(true);
 }
Пример #2
0
 public virtual bool Remove <T>(T module)
 {
     if (module is IUpdate)
     {
         IUpdate v = (IUpdate)module;
         m_UpdateList.Remove(v);
     }
     if (module is IDestroy)
     {
         IDestroy v = (IDestroy)module;
         m_DestroyList.Remove(v);
     }
     return(true);
 }
Пример #3
0
        public override void Drink(object obj)
        {
            IDestroy destroyObject = obj as IDestroy;

            if (destroyObject != null)
            {
                //TODO: переделать
                //destroyObject.currentHealtPoint += addingHealthPoints;
                Variables.player.currentHealtPoint += (Variables.player.maxHealthPoint - Variables.player.currentHealtPoint > addingHealthPoints) ?
                                                      addingHealthPoints : Variables.player.maxHealthPoint - Variables.player.currentHealtPoint;
            }
            else
            {
                EventLog.doEvent("Нельзя выпить", ConsoleColor.White);
            }
        }
Пример #4
0
 private void Awake()
 {
     _spawn      = GetComponent <ISpawn>();
     _destroy    = GetComponent <IDestroy>();
     _difficulty = GetComponent <IDifficulty>();
 }
Пример #5
0
        public void DoAttack(IDestroy mapObject)
        {
            int damage = GetDamage();

            mapObject.SetDamage(damage);
        }