Beispiel #1
0
        internal WorldPart(MapItem data, MapInfo mapDataList, SencePart sencePart, int collusionLayer, MapManager.MapLoadingData loadingData)
        {
            m_data = loadingData;
            int count = data.List.Count;
            m_manager = WorldManager.GetInstance();
            m_mapData = sencePart;
            m_collusionLayer = collusionLayer;

            //m_filepath = new string[count];
            m_layers = new MapDrawer[count +1];
            string path = "Maps/" + mapDataList.Name + "/";
            m_locate = new Vector2(data.X * ImageSize, data.Y * ImageSize);

            foreach( var textureInfo in data.List)
            {
                DataReader.LoadAsync<Texture2D>( path + textureInfo.Texture, LoadingItemCallback, textureInfo.Layer );
                m_data.LoadingLeft++;
            }
        }
Beispiel #2
0
 private void SwitchTo(RunningState runningState, object param)
 {
     if (runningState == RunningState.Running && State == RunningState.Loading)
     {
         InternalLoad(m_data);
     }
     else if (runningState == RunningState.Loading)
     {
         m_data = (MapManager.MapLoadingData)param;
         m_loadingTimer = 0;
     }
     else if (runningState == RunningState.Speaking)
     {
         this.UpdateDraw(new GameTime());
         AIControler.Update(new GameTime(), m_units, m_item, Player);
         DrawRunning(new GameTime(), SpriteManager.SpriteBatch);
         m_dialog.Load(param.ToString(), m_resolveTexture);
     }
     else if (runningState == RunningState.Viewing)
     {
         m_camera.Load((string)param);
     }
     else if(runningState == RunningState.Splash)
     {
     }
     State = runningState;
 }