private static void FightResult(Group winningGroup, Group losingGroup) { foreach (Character perso in losingGroup.GetAllCharacters()) { losingGroup.GiveCharacter (perso.name, winningGroup); } Destroy (losingGroup.gameObject); }
public void GiveCharacter (string name, Group otherGroup) { otherGroup.AddCharacter (mCharacters [name.ToLower()]); mCharacters.Remove (name.ToLower()); if (OnGroupChanged != null) { OnGroupChanged (); } }
private void Fight (Group otherGroup) { int comparison = otherGroup.GetTotalStrength ().CompareTo (thisGroup.GetTotalStrength ()); switch (comparison) { case -1: FightResult (thisGroup, otherGroup); break; case 1: FightResult (otherGroup, thisGroup); break; case 0: Debug.Log ("Deuce."); break; default: Debug.LogError ("Unknown comparison result : " + comparison); break; } }
private bool IsHostile (Group otherGroup) { return true; }
void Awake () { thisGroup = this.GetComponent<Group> (); }