/// <summary> /// Checks if the adding group is an atacker or a deffender and inserts it to /// the appropriate group and recalculates it. /// </summary> /// <param name="group">The inserting group.</param> public void AddGroup(GroupMovables group) { GroupManager groupMgr = Game.GroupManager; if (group.Team == groupAttackers.Team) { // Group is attacker int groupCount = group.Count; for (int i = 0; i < groupCount; i++) { IMovableGameObject temp = group[0]; groupMgr.RemoveFromGroup(temp); groupMgr.AddToGroup(groupAttackers, temp); temp.StartAttack(this); } groupAttackers.Reselect(); groupMgr.SelectGroup(groupAttackers); } else { // Group is deffender int groupCount = group.Count; for (int i = 0; i < groupCount; i++) { IMovableGameObject temp = group[0]; groupMgr.RemoveFromGroup(temp); groupMgr.AddToGroup(imgoDeffenders, temp); temp.StartAttack(this); } groupAttackers.Reselect(); groupMgr.SelectGroup(imgoDeffenders); } }
/// <summary> /// Receives information that the object reached the destiantion. /// </summary> /// <param name="imgo">The object in destination.</param> public void MovementFinished(IMovableGameObject imgo) { movingDict.Remove(imgo); imgo.StartAttack(this); }
/// <summary> /// Receives information that the object reached the destiantion. /// </summary> /// <param name="imgo">The object in the destination.</param> public void MovementFinished(IMovableGameObject imgo) { movingDict.Remove(imgo); imgo.StartAttack(this); }