public void GrantXP(int amount) { Debug.Assert(amount >= 0, "xp should never go down"); xp += amount; if (assignedShip) { var gain = new XPGain() { Amount = amount, CrewMember = this }; assignedShip.SendMessage("OnCrewMemberGainedXP", gain, SendMessageOptions.DontRequireReceiver); } }
private void OnCrewMemberGainedXP(XPGain xpGain) { var msg = string.Format("{0} gained {1} XP", xpGain.CrewMember.name, xpGain.Amount); GUIController.Current.BroadcastMessage("OnPlayerNotification", msg, SendMessageOptions.DontRequireReceiver); }