#region File Description //----------------------------------------------------------------------------- // GameRule.cs // // Microsoft XNA Community Game Platform // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- #endregion #region Using Statements using System; using System.Collections.Generic; using System.Text; #endregion namespace CardsFramework { /// /// Represents a rule in card game. /// /// /// Inherit from this class and write your code /// public abstract class GameRule { /// /// An event which triggers when the rule conditions are matched. /// public event EventHandler RuleMatch; /// /// Checks whether the rule conditions are met. Should call /// . /// public abstract void Check(); /// /// Fires the rule's event. /// /// Event arguments. protected void FireRuleMatch(EventArgs e) { if (RuleMatch != null) { RuleMatch(this, e); } } } }