public override void Init(CharData charData, GameMap gameMap) { base.Init(charData, gameMap); }
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); }
public virtual void Init(CharData charData, GameMap gameMap) { _charData = charData; _gameMap = gameMap; Id = charData.roleId; }
/// <summary> /// 初始化 /// </summary> public void Init() { _logicMap = new GameMap(); viewOjbList = new List<ViewObj>(); }
/// <summary> /// 初始化 /// </summary> public void Init() { _logicMap = new GameMap(); viewOjbList = new List <ViewObj>(); }
public override void Init(CharData charData, GameMap gameMap) { base.Init(charData, gameMap); _gameMap.curObj = this; }