public override IUnit MC() { IUnit A = new Decorate(((Decorate)this)); A = (Decorate)this.MemberwiseClone(); return(A); }
public Decorate(Decorate A) { health = Convert.ToInt16(A.Helth()); maxAttack = A.maxAttack; maxHealth = A.maxHealth; cost = A.GetCost(); SH = A.SH; L = A.L; K = A.K; h = A.h; }
public bool DoSA(List <IUnit> friends, List <IUnit> enemies, Army A) { if (friends.Count() <= 1) { return(false); } for (int i = 0; i < friends.Count(); i++) { if (friends[i] is HeavyUnit || friends[i] is Decorate) { IUnit B; if (friends[i] is Decorate) { B = friends[i]; } else { B = new Decorate((HeavyUnit)(friends[i])); } if (arr[0] == 1) { if (((Decorate)B).YouHaveSH()) { arr[0] = 0; A.Change(friends[i], B); } } else if (arr[1] == 1) { if (((Decorate)B).YouHaveK()) { arr[1] = 0; A.Change(friends[i], B); } } else if (arr[2] == 1) { if (((Decorate)B).YouHaveL()) { arr[2] = 0; A.Change(friends[i], B); } } break; } } return(false); }