Beispiel #1
0
        public void TestSimple()
        {
            ActionBus bus = new ActionBus();

            bus.Subscribe <ActionType, ActionType>(new Action <ActionType>(Callback));
            bus.Signal <ActionType, ActionType>(new ActionType());
        }
Beispiel #2
0
 public EntityFactory(GameEngine gameEngine)
 {
     m_factory = context =>
     {
         return(new DefaultEnity());
     };
     m_actionBus = gameEngine.SytemActionBus;
 }
Beispiel #3
0
        public async Task <ActionResult> Pay(int id)
        {
            var            action   = new InvestmentPayRequest(id);
            ActionResponse response = await ActionBus.SendAsync <InvestmentActionBase, InvestmentPayRequest>(action);

            TempData["ActionResponse"] = response;
            return(RedirectToAction("Index", new { id = action.InvestmentId }));
        }
Beispiel #4
0
        public async Task <ActionResult> Create(InvestViewModel vm)
        {
            var action = new InvestmentCreateRequest(_sequenceService.Next(SequenceID.ACE_Investment, 1), vm.AccountId, vm.ProjectId, vm.Amount);

            var response = await ActionBus.SendAsyncWithRetry <InvestmentActionBase, InvestmentCreateRequest>(action, 3);

            TempData["ActionResponse"] = response;
            return(RedirectToAction("Index", new { id = action.InvestmentId }));
        }
Beispiel #5
0
 static public void RegisterForDefaultAdventureEngine(ActionBus actionBus)
 {
     actionBus.Subscribe <StartEvent, EntityEvent>((data) => StartEvent.OnStartEntityEvent(data));
     actionBus.Subscribe <InitEvent, EntityEvent>((data) => InitEvent.OnInitEntityEvent(data));
     actionBus.Subscribe <EndEvent, EntityEvent>((data) => EndEvent.OnStopEntityEvent(data));
 }