public void TestSimple() { ActionBus bus = new ActionBus(); bus.Subscribe <ActionType, ActionType>(new Action <ActionType>(Callback)); bus.Signal <ActionType, ActionType>(new ActionType()); }
public EntityFactory(GameEngine gameEngine) { m_factory = context => { return(new DefaultEnity()); }; m_actionBus = gameEngine.SytemActionBus; }
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 })); }
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 })); }
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)); }