예제 #1
0
        public static FieldInfo GetFinishCallBack(AbstractGame game)
        {
            FieldInfo callBackField = PrivateValueAccessor.GetPrivateFieldInfo(game.GetType().BaseType, "callback_0");

            if (callBackField == null)
            {
                return(null);
            }

            return(callBackField);
        }
예제 #2
0
        public static FieldInfo GetCreatePlayerFunc(AbstractGame game)
        {
            FieldInfo createOwnerFunc = PrivateValueAccessor.GetPrivateFieldInfo(game.GetType().BaseType, "func_0");

            if (createOwnerFunc == null)
            {
                return(null);
            }

            return(createOwnerFunc);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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;
        }
예제 #6
0
 public UserControl getGameGUI(AbstractGame game)
 {
     var gamegui = GameDict[game.GetType().Name].GameGuiFunc();
     var gui = gamegui.GetGameGUI();
     gamegui.AddToGame(game, PlayerType.PlayerOne);
     return gui;
 }