Synchronous Input
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
1 post
• Page 1 of 1
Synchronous Input
by Max mtg » 27 Feb 2013, 21:50
There are two ways how forge gets user's choice of some cards or players:
* GuiChoose
* Input (sometimes InputSelectMany*)
First option returns control to caller only when choice is made - a good synchronous method. The latter one sets input and immediatelly returns, so that the remainder of ability code is executed from inside input's "done" method. That's an asynchronous call I cannot move to PlayerController class (to make that ability/effect indifferent to player type).
see forge.card.cardfactory.CardFactoryArtifacts.buildCard(...).AbilityScrollRack.resolve() for example.
Do you know how to make that Input-based requests synchronous?
* GuiChoose
* Input (sometimes InputSelectMany*)
First option returns control to caller only when choice is made - a good synchronous method. The latter one sets input and immediatelly returns, so that the remainder of ability code is executed from inside input's "done" method. That's an asynchronous call I cannot move to PlayerController class (to make that ability/effect indifferent to player type).
see forge.card.cardfactory.CardFactoryArtifacts.buildCard(...).AbilityScrollRack.resolve() for example.
Do you know how to make that Input-based requests synchronous?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 18 guests