예제 #1
0
 private void TurnReady()
 {
     if (currentTrun == 0) //0 turn(at start), setting start Position 0턴(맨 시작 턴)
     {
         SetPosition();
     }
     else if (currentTrun > 0)
     {
         playFSM = GamePlayFSM.gotoNextTurn;
     }
 }
예제 #2
0
 private void WhileTurn()//턴 넘기기, 나중에 기능추가
 {
     EventHandler.instance.set = false;
     //이벤트 생성후 시간이 지나간다.주민생성 등등
     if (EventHandler.instance.newsDone)
     {
         //
         if (turnTime > 0)
         {
             turnTime -= Time.deltaTime;
         }
         else if (turnTime <= 0)
         {
             playFSM = GamePlayFSM.afterTurn;
         }
     }
 }
예제 #3
0
파일: Core.cs 프로젝트: wxl-007/ShadowDota
    /// <summary>
    /// Initialize this instance.
    /// We must follow special sequnce.
    /// 仅且仅初始化一次
    /// </summary>
    public static void Initialize(EngineCfg cfg)
    {
        ConsoleEx.DebugLog("Core Engine is initializing ....", ConsoleEx.YELLOW);
        //Initial sequnce
        DevFSM  = DeviceFSM.Instance;
        GameFSM = GamePlayFSM.Instance;
        EngCfg  = cfg;

        if (GameFSM.InitOK == Consts.FAILURE)
        {
            //Have one NetMQContext ONLY. This will be used to created ALL sockets within the process.
            ZeroMQ = NetMQContext.Create();

            //DataPersisteManager should be initialize first. and tell the non-account path
            DPM = LocalIOManager.getInstance(DeviceInfo.PersistRootPath);
            //Unity UI Basically Manager
            EntityMgr = new EntityManager();
            //Timer should run.
            TimerEng = new TimerMaster();
            //Sound manager.
            SoundEng = SoundEngine.GetSingleton();
            //EventCenter must initialize later than Network Engine
            NetEng = new NetworkEngine();
            //EventCenter also must initialize later than Aysnc Engine
            AsyncEng = AsyncTask.Current;
            //Coroutine
            Coroutine = CoroutineProvider.Instance();

            EVC    = new EventCenter(NetEng.httpEngine, NetEng.SockEngine, EntityMgr);
            ResEng = new Loader();

            Data = new DataCore();

            //register some vars.
            CoreParam();
        }
        else
        {
            //TODO: 此分支是初始化一次OK后,注销之后进入的分支情况
        }

        RegisterInterface();
        ConsoleEx.DebugLog("Core Engine is initialized ....", ConsoleEx.YELLOW);
        GameFSM.OnInitOk();
    }
예제 #4
0
    static public void JumpToScene(GamePlayFSM gameplay, string target)
    {
        if (!string.IsNullOrEmpty(target))
        {
            Application.LoadLevel(target);

            if (gameplay != null)
            {
                StateParam <GameState> param = new StateParam <GameState>();
                param.NowGameState = GameState.LevelChanged;
                param.obj          = new LevelChanged()
                {
                    curLevel    = Application.loadedLevelName,
                    targetLevel = target,
                };
                gameplay.handleStateChg(param, GameState.LevelChanged);
            }
        }
    }
예제 #5
0
    private void StartTurn() //Start Turn //시작하기전 이벤트 현재 턴에 나올 이벤트셋 턴 시간 리셋,모든 이벤트는 1턴 이후에 나온다.
    {
        turnTime = 30;
        if (currentTrun == 1)
        {
            GiveActionPoint();
            playFSM = GamePlayFSM.whileTurn;
        }
        else if (currentTrun > 1)
        {
            //이벤트보여준다.
            //보여준 후


            if (EventHandler.instance.set)
            {
                GiveActionPoint();               //액션포인트 추가
                playFSM = GamePlayFSM.whileTurn; // 진행 턴으로
            }
        }
    }
예제 #6
0
        public void EnterWar(ServerInfo Server, MapInfo Map)
        {
            ConsoleEx.DebugLog(war.Side.ToString() + " Sub Received : Enter War.", ConsoleEx.YELLOW);

            GamePlayFSM fsm = Core.GameFSM;

            if (fsm.CurScene != SceneName.BattleScene)
            {
                if (hasEntered == false)
                {
                    hasEntered = true;

                    monitor.EnterWar(Server.ServerID);
                    cached.map = Map;
                    AsyncTask.QueueOnMainThread(
                        () => {
                        //UnityUtils.JumpToScene(Core.GameFSM, SceneName.BattleScene);
                        Jumper.EnterWarDataInitFinished();
                    }
                        );
                }
            }
        }