コード例 #1
0
ファイル: Player.cs プロジェクト: caolaoyao/AsycClient
 public override void Init(CharData charData, GameMap gameMap)
 {
     base.Init(charData, gameMap);
 }
コード例 #2
0
        public static bool ServerOrSingle_MapCreate()
        {
            GameNetworkServer server = GameNetworkServer.Instance;

            EControl mapLoadingWindow = null;

            //show map loading window
            {
                mapLoadingWindow = ControlDeclarationManager.Instance.CreateControl(
                    "Gui\\MapLoadingWindow.gui");
                if (mapLoadingWindow != null)
                {
                    mapLoadingWindow.Text = "[Dynamic map creating]";
                    GameEngineApp.Instance.ControlManager.Controls.Add(mapLoadingWindow);
                }
                EngineApp.Instance.RenderScene();
            }

            //delete all GameWindow's
            GameEngineApp.Instance.DeleteAllGameWindows();

            MapSystemWorld.MapDestroy();

            //create world if need
            WorldType worldType = EntitySystemWorld.Instance.DefaultWorldType;

            if (World.Instance == null || World.Instance.Type != worldType)
            {
                WorldSimulationTypes worldSimulationType;
                EntitySystemWorld.NetworkingInterface networkingInterface = null;

                if (server != null)
                {
                    worldSimulationType = WorldSimulationTypes.ServerAndClient;
                    networkingInterface = server.EntitySystemService.NetworkingInterface;
                }
                else
                {
                    worldSimulationType = WorldSimulationTypes.Single;
                }

                if (!EntitySystemWorld.Instance.WorldCreate(worldSimulationType, worldType,
                                                            networkingInterface))
                {
                    Log.Fatal("EntitySystemWorld.Instance.WorldCreate failed.");
                }
            }

            //create map
            GameMapType gameMapType = EntityTypes.Instance.GetByName("GameMap") as GameMapType;

            if (gameMapType == null)
            {
                Log.Fatal("GameEngineApp: MapCreateForDynamicMapExample: \"GameMap\" type " +
                          "is not defined.");
            }
            GameMap gameMap = (GameMap)Entities.Instance.Create(gameMapType, World.Instance);

            gameMap.ShadowFarDistance = 60;

            //create MapObjects
            ServerOrSingle_CreateEntities();

            //post create map
            gameMap.PostCreate();

            //inform clients about world created
            if (server != null)
            {
                server.EntitySystemService.InformClientsAfterWorldCreated();
            }

            //Error
            foreach (EControl control in GameEngineApp.Instance.ControlManager.Controls)
            {
                if (control is MessageBoxWindow && !control.IsShouldDetach())
                {
                    return(false);
                }
            }

            GameEngineApp.Instance.CreateGameWindowForMap();

            //play music
            if (GameMap.Instance != null)
            {
                GameMusic.MusicPlay(GameMap.Instance.GameMusic, true);
            }

            return(true);
        }
コード例 #3
0
ファイル: GameObj.cs プロジェクト: caolaoyao/AsycClient
 public virtual void Init(CharData charData, GameMap gameMap)
 {
     _charData = charData;
     _gameMap = gameMap;
     Id = charData.roleId;
 }
コード例 #4
0
ファイル: ViewMap.cs プロジェクト: caolaoyao/AsycClient
 /// <summary>
 /// 初始化
 /// </summary>
 public void Init()
 {
     _logicMap = new GameMap();
     viewOjbList = new List<ViewObj>();
 }
コード例 #5
0
 /// <summary>
 /// 初始化
 /// </summary>
 public void Init()
 {
     _logicMap   = new GameMap();
     viewOjbList = new List <ViewObj>();
 }
コード例 #6
0
ファイル: Player.cs プロジェクト: xiaogeformax/LockStepClient
 public override void Init(CharData charData, GameMap gameMap)
 {
     base.Init(charData, gameMap);
 }
コード例 #7
0
ファイル: MePlayer.cs プロジェクト: caolaoyao/AsycClient
 public override void Init(CharData charData, GameMap gameMap)
 {
     base.Init(charData, gameMap);
     _gameMap.curObj = this;
 }
コード例 #8
0
 public override void Init(CharData charData, GameMap gameMap)
 {
     base.Init(charData, gameMap);
     _gameMap.curObj = this;
 }