Esempio n. 1
0
        public void testname()
        {
            var service     = new CommandHubService();
            var dumbService = new DumbService();

            // act
            service.Subscribe <Something>(dumbService.Do);
            service.Send(new Something());

            dumbService.Done
            .Should()
            .BeTrue();
        }
Esempio n. 2
0
        public Game()
        {
            SetupLog();
            log.Information("New game started");

            Hub = new CommandHubService();
            var campService = new CampService();

            Hub.Subscribe <DiggerInCamp>(campService.Handle);
            Hub.Subscribe <DiggerLeftCamp>(campService.Handle);
            services.Add(campService);

            var storeService = new StoreService();

            Hub.Subscribe <DiggerInStore>(storeService.Handle);
            Hub.Subscribe <DiggerLeftStore>(storeService.Handle);
            Hub.Subscribe <PlayerOpenStore>(storeService.Handle);
            Hub.Subscribe <PlayerBuyItem>(storeService.Handle);
            services.Add(storeService);

            CreatePlayer();
        }
Esempio n. 3
0
 public Camp(CommandHubService service)
 {
     this.service = service;
 }
Esempio n. 4
0
 public Player(CommandHubService hub)
 {
     this.hub = hub;
     log.Information("{actor} created", "Player");
 }
Esempio n. 5
0
 public BlockBuilder BuildStore(CommandHubService hub = null)
 {
     hub = hub ?? new CommandHubService();
     map.TileMap[2, 1].SetItem(new Store(hub));
     return(this);
 }
Esempio n. 6
0
 public Store(CommandHubService service)
 {
     this.service = service;
 }