Esempio n. 1
0
        public PlayerTests()
        {
            System.Func <string, IGameAction> ok = (string m) => ActionOutcome.Success(m).AsAction();
            var verbList = new List <IVerb <DummyEntity> >()
            {
                new ZeroTargetVerb <DummyEntity>((e) => ok($"entity#{e}.meditate()"), "meditate"),
                new SingleTargetVerb <DummyEntity>(DummyLookup, (e, t) => ok($"entity#{e}.contemplate(entity#{t})"), "contemplate"),
                new SingleTargetVerbWithTool <DummyEntity>(DummyLookup, (e, v, t) => ok($"entity#{e}.shave(entity#{v}, entity#{t})"), "shave"),
            };

            verbSuite = new(verbList);
        }
Esempio n. 2
0
 public Player(VerbSuite <T> verbSuite, IPlayerIO io)
 {
     this.verbSuite = verbSuite;
     this.io        = io;
 }