示例#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");
            }
        }
示例#2
0
文件: Game.cs 项目: edumbell/stakeout
        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();
            }
        }
示例#3
0
文件: Game.cs 项目: edumbell/stakeout
 public void ProcessNightInsruction(NightInstruction i)
 {
 }