public static FieldInfo GetFinishCallBack(AbstractGame game) { FieldInfo callBackField = PrivateValueAccessor.GetPrivateFieldInfo(game.GetType().BaseType, "callback_0"); if (callBackField == null) { return(null); } return(callBackField); }
public static FieldInfo GetCreatePlayerFunc(AbstractGame game) { FieldInfo createOwnerFunc = PrivateValueAccessor.GetPrivateFieldInfo(game.GetType().BaseType, "func_0"); if (createOwnerFunc == null) { return(null); } return(createOwnerFunc); }
public static FieldInfo GetFinishCallBack(AbstractGame game) { FieldInfo callBackField = GetPrivateFieldInfo(game.GetType().BaseType, "callback_0"); if (callBackField != null) { return(callBackField); } Debug.LogError("LocalGameUtils GetFinishCallBack() callBackField is null"); return(null); }
public static FieldInfo GetCreatePlayerFunc(AbstractGame game) { FieldInfo createOwnerFunc = GetPrivateFieldInfo(game.GetType().BaseType, "func_0"); if (createOwnerFunc != null) { return(createOwnerFunc); } Debug.LogError("LocalGameUtils GetCreatePlayerFunc() createOwnerFunc is null"); return(null); }
public AbstractGame StartNetworkGame(string gameType, PlayerType playerType) { currentGame = GameDict[gameType].GameFunc(); var gamegui = GameDict[currentGame.GetType().Name].GameGuiFunc(); currentGameGUI = gamegui.GetGameGUI(); gamegui.AddToGame(currentGame, playerType); currentPlayerType = playerType; otherPlayerType = (playerType == PlayerType.PlayerOne) ? PlayerType.PlayerTwo : PlayerType.PlayerOne; AbstractGame.StepHandler stepHandler = StepHandler; currentGame.RegisterAsPlayer(ref stepHandler, otherPlayerType); return currentGame; }
public UserControl getGameGUI(AbstractGame game) { var gamegui = GameDict[game.GetType().Name].GameGuiFunc(); var gui = gamegui.GetGameGUI(); gamegui.AddToGame(game, PlayerType.PlayerOne); return gui; }