public MinesweeperEvent(string callBackKey, MinesweeperEventArgs e) { CallbackKey = callBackKey; Args = new List<int> { e.X, e.Y, e.UserId }; Id = e.EventId; Timestamp = DateTimeOffset.Now; }
void RecordUnflag(object sender, MinesweeperEventArgs e) { lock (_journal) { _journal.Enqueue(new MinesweeperEvent("unflag", e)); } }
void RecordSpecialUncover(object sender, MinesweeperEventArgs e) { lock (_journal) { _journal.Enqueue(new MinesweeperEvent("specialUncover", e)); } }
public MinesweeperEvent(string callBackKey, MinesweeperEventArgs e) { CallbackKey = callBackKey; Args = new List <int> { e.X, e.Y, e.UserId }; Id = e.EventId; Timestamp = DateTimeOffset.Now; }
public virtual void OnUnflag(MinesweeperEventArgs e) { var x = e.X; var y = e.Y; if (Board[x, y].FlagOwnerId == e.UserId) { Board.Unflag(e.X, e.Y, e.UserId); Unflag(this, e); } }
public virtual void OnFlag(MinesweeperEventArgs e) { var x = e.X; var y = e.Y; var userId = e.UserId; var cell = Board[x, y]; if(cell.FlagOwnerId != null && cell.FlagOwnerId != userId) { //By default do not allow //different players to flag the same cell return; } Board.Flag(x, y, userId); Flag(this, e); }
public virtual void OnFlag(MinesweeperEventArgs e) { var x = e.X; var y = e.Y; var userId = e.UserId; var cell = Board[x, y]; if (cell.FlagOwnerId != null && cell.FlagOwnerId != userId) { //By default do not allow //different players to flag the same cell return; } Board.Flag(x, y, userId); Flag(this, e); }
public virtual void OnUncover(MinesweeperEventArgs e) { Board.Uncover(e.X, e.Y, e.UserId); Uncover(this, e); }
protected virtual void HandleSpecialUncover(object sender, MinesweeperEventArgs e) { }
protected virtual void HandleUnflag(object sender, MinesweeperEventArgs e) { var userId = e.UserId; Scores[userId] = Controller.Board.GetNumFlags(userId); }
public virtual void OnSpecialUncover(MinesweeperEventArgs e) { Board.SpecialUncover(e.X, e.Y, e.UserId); SpecialUncover(this, e); }
protected virtual void HandleUncover(object sender, MinesweeperEventArgs e) { }