Exemple #1
0
		private static void FightResult(Group winningGroup, Group losingGroup) {
			foreach (Character perso in losingGroup.GetAllCharacters()) {
				losingGroup.GiveCharacter (perso.name, winningGroup);
			}

			Destroy (losingGroup.gameObject);
		}
Exemple #2
0
		public void GiveCharacter (string name, Group otherGroup)
		{
			otherGroup.AddCharacter (mCharacters [name.ToLower()]);
			mCharacters.Remove (name.ToLower());

			if (OnGroupChanged != null) {
				OnGroupChanged ();
			}
		}
Exemple #3
0
		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;
			}
		}
Exemple #4
0
		private bool IsHostile (Group otherGroup)
		{
			return true;
		}
Exemple #5
0
		void Awake ()
		{
			thisGroup = this.GetComponent<Group> ();
		}