/// <summary> /// Completes this <c>Mission</c>'s by opening its <c>Gate</c>. /// </summary> /// <returns>If <c>Schedule</c> doesn't approve, the mission cannot be completed /// and thus returns <c>false</c>; otherwise opens this <c>Mission</c>'s /// <c>Gate</c> and returns <c>true</c> if successful.</returns> public bool Complete() { if (!Schedule.Approve(MissionStorage.GetTimesCompleted(this))) { SoomlaUtils.LogDebug(TAG, "missions cannot be completed b/c Schedule doesn't approve."); return(false); } SoomlaUtils.LogDebug(TAG, "trying opening gate to complete mission: " + ID); return(Gate.Open()); }
/// <summary> /// Determines whether this <c>Mission</c> is available by checking the criteria /// that makes the specific <c>Mission</c> available. /// </summary> /// <returns>If this instance is available returns <c>true</c>; otherwise <c>false</c>.</returns> public virtual bool IsAvailable() { return(Gate.CanOpen() && Schedule.Approve(MissionStorage.GetTimesCompleted(this))); }