Exemplo n.º 1
0
 public void AddDemolitionCondition(DemoCondition condition)
 {
     if (!demolishConditions.Contains(condition))
     {
         demolishConditions.Add(condition);
     }
 }
Exemplo n.º 2
0
 public void RemoveDemolitionCondition(DemoCondition condition)
 {
     if (demolishConditions.Contains(condition))
     {
         demolishConditions.Remove(condition);
     }
 }
Exemplo n.º 3
0
        public void Demolish()
        {
            DemoCondition condition = demolishConditions.FirstOrDefault(d => !d.condition(this));

            if (condition != null)
            {
                //TODO
                return;
            }

            foreach (KeyValuePair <int, IBuildingModule> item in modules)
            {
                item.Value.OnDemolish();
            }

            Destroy(gameObject);
        }