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

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

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