Skip to content

Commit

Permalink
Code updated
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurits committed May 5, 2020
1 parent 2aa878d commit 31b464f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions MemoryNumbers/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ private void ApplySettings(bool WindowSettings = false)
this._game.MaximumAttempts = Convert.ToInt32(_programSettings["MaximumAttempts"]);
this._game.MaximumDigit = Convert.ToInt32(_programSettings["MaximumDigit"]);
this._game.MinimumDigit = Convert.ToInt32(_programSettings["MinimumDigit"]);
this._game.PlayMode = (PlayMode)Enum.Parse(typeof(PlayMode), _programSettings["PlayMode"]);
this.board1.Time = Convert.ToInt32(_programSettings["Time"]);
this.board1.TimeIncrement = _programSettings.ContainsKey("TimeIncrement") ? Convert.ToInt32(_programSettings["TimeIncrement"]) : 0;
this.board1.BorderRatio = Convert.ToSingle(_programSettings["BorderRatio"]);
Expand Down
19 changes: 15 additions & 4 deletions MemoryNumbers/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public class Game
private int _nCurrAttempt = 0; // The accumulated number of attempts
private int _nMinLength = 2; // The minimum length of the initial _nSequence array
private int[] _nSequence;


private PlayMode _playMode; // The current play mode
private int _nTime;
private int _nTimeIncremental;

#endregion Private variables

Expand Down Expand Up @@ -102,12 +103,22 @@ public class Game
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public int[] GetSequence { get => _nSequence; }

/// <summary>
/// The actual play-mode selected by the user (time and sequence mode).
/// </summary>
[Description("The actual play-mode selected by the user (time and sequence mode)"),
Category("Sequence properties"),
Browsable(true),
EditorBrowsable(EditorBrowsableState.Always),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public PlayMode PlayMode { get => _playMode; set => _playMode = value; }

#endregion Public properties

#region Events

#region Events definitions
public event EventHandler<TickEventArgs> Tick;
#region Events definitions
public event EventHandler<TickEventArgs> Tick;
public event EventHandler<WrongEventArgs> WrongSequence;
public event EventHandler<CorrectEventArgs> CorrectSequence;
public event EventHandler<OverEventArgs> GameOver;
Expand Down

0 comments on commit 31b464f

Please sign in to comment.