/// <summary> /// Initializes a new instance of the <see cref="GreenRule"/> class. /// </summary> /// <param name="axiom">The axiom.</param> public GreenRule(IAxiom axiom) { if (axiom == null) { throw new ArgumentNullException(nameof(axiom)); } this.EvenNumbers = axiom.EvenNumbers; }
/// <summary> /// Initializes a new instance of the <see cref="IndigoRule"/> class. /// </summary> /// <param name="axiom">Axiom.</param> public IndigoRule(IAxiom axiom) { if (axiom == null) { throw new ArgumentNullException(nameof(axiom)); } this.Runs = axiom.Runs; }
/// <summary> /// Initializes a new instance of the <see cref="Card"/> class. /// </summary> /// <param name="colour">Colour.</param> /// <param name="number">Card.</param> /// <param name="axiom">Game Axioms.</param> public Card(Colour colour, Number number, IAxiom axiom) { if (axiom == null) { throw new ArgumentNullException(nameof(axiom)); } this.Colour = colour; this.Number = number; this.Rule = axiom.GetRule(colour); }
/// <summary> /// Initializes a new instance of the <see cref="Canvas"/> class. /// </summary> /// <param name="axiom">Game axioms.</param> public Canvas(IAxiom axiom) { if (axiom == null) { throw new ArgumentNullException(nameof(axiom)); } // Canvas is empty of cards this.CardList = new List <ICard>(); // Default rule to start the game with this.DefaultRule = axiom.DefaultRule; }
/// <summary> /// Initializes a new instance of the <see cref="Deck"/> class. /// </summary> /// <param name="axiom">The axiom.</param> public Deck(IAxiom axiom) { this.Axiom = axiom; // Create a Deck of of all the possible Cards this.CardList = new List <ICard>(); foreach (Colour colour in typeof(Colour).GetEnumValues().Cast <Colour>()) { foreach (Number number in typeof(Number).GetEnumValues().Cast <Number>()) { this.CardList.Add(new Card(colour, number, axiom)); } } // Shuffle the Deck this.Shuffle(); }
public ExpressionMaker(IAxiom _axiom) { axiom = _axiom; }
public bool remove(IAxiom axiom) { _axiom_list.Remove(axiom); return(true); }
public bool add(IAxiom axiom) { _axiom_list.Add(axiom); return(true); }