public void Setup() { var participant = new ActionParticipant("name", isNpc: false); var participants = new[] { participant }; var dice = DiceFactory.Create(new Random()); setInitiativesViewModel = new SetInitiativesViewModel(participants, dice); participant.Initiative = 1; getNextInitiativeCommand = new GetNextInitiativeCommand(setInitiativesViewModel); }
public SetInitiativesViewModel(IEnumerable<ActionParticipant> participants, IDice dice) { this.participants = participants; this.dice = dice; DecrementInitiativeCommand = new DecrementInitiativeCommand(this); IncrementInitiativeCommand = new IncrementInitiativeCommand(this); GetNextInitiativeCommand = new GetNextInitiativeCommand(this); ZeroOutAllInitiatives(); SetNpcInitiatives(); currentParticipant = participants.FirstOrDefault(p => p.Initiative == 0); }