It is currently 10 Sep 2025, 18:59
   
Text Size

Synchronous Input

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Synchronous Input

Postby 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?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 18 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 18 users online :: 0 registered, 0 hidden and 18 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 18 guests

Login Form