/// <summary> /// Initializes a new instance of the <see cref="GoalCell"/> class. /// </summary> /// <param name="location">The location of the goal /// on the level grid.</param> /// <param name="level">The level grid where this cell /// is located.</param> /// <param name="contents">The contents of this goal cell.</param> public GoalCell(Location location, Level level, CellContents contents) : base(cellName, location, level, contents) { }
/// <summary> /// Tries the set the contents of this goal. /// </summary> /// <param name="contents">The contents to set.</param> /// <returns><code>true</code> if the contents /// was successfully placed on the goal, <code>false</code> otherwise. /// </returns> public override bool TrySetContents(CellContents contents) { if (base.TrySetContents(contents)) { if (contents is Treasure) { OnCompletedGoalChanged(EventArgs.Empty); } return true; } return false; }