예제 #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();
        }
예제 #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();
        }
예제 #3
0
 public Camp(CommandHubService service)
 {
     this.service = service;
 }
예제 #4
0
 public Player(CommandHubService hub)
 {
     this.hub = hub;
     log.Information("{actor} created", "Player");
 }
예제 #5
0
 public BlockBuilder BuildStore(CommandHubService hub = null)
 {
     hub = hub ?? new CommandHubService();
     map.TileMap[2, 1].SetItem(new Store(hub));
     return(this);
 }
예제 #6
0
 public Store(CommandHubService service)
 {
     this.service = service;
 }