Ejemplo n.º 1
0
        public GameEvent(NightInstruction ni)
        {
            Speaker = ni.Actor;
            Whom    = ni.Whom;
            switch (ni.Action)
            {
            case NightActionEnum.Bite:
                EventType = EventTypeEnum.Bite;
                break;

            case NightActionEnum.Sleep:
                EventType = EventTypeEnum.Sleep;
                break;

            case NightActionEnum.Watch:
                EventType = EventTypeEnum.Watch;
                break;

            default:
                throw new Exception("Unsupported Night Instruction enum");
            }
        }
Ejemplo n.º 2
0
        public void ProcessNightInstruction(NightFormModel model)
        {
            var i = new NightInstruction(this, model);

            i.Actor.AI.LastNightAction = model;
            var logEvent = new GameEvent(i);

            AddToLog(logEvent);
            if (CurrentTurn().NightInstructions.Any())
            {
                var existing = CurrentTurn().NightInstructions.Where(x => x.Actor == i.Actor).FirstOrDefault();
                if (existing != null)
                {
                    throw new Exception("Night instructions already given for player & turn.");
                }
            }
            CurrentTurn().NightInstructions.Add(i);
            Hub.DisplayNightActionsEntered(this);
            if (CurrentTurn().NightInstructions.Count() == MobilePlayers.Count())
            {
                FinishNight();
            }
        }
Ejemplo n.º 3
0
 public void ProcessNightInsruction(NightInstruction i)
 {
 }