public void load() { var playerFileName = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\SkyLands\\" + this.getName() + "-player" + ".sav"; StreamReader stream; try { stream = new StreamReader(playerFileName); } catch { throw new Exception("Could not read file : " + playerFileName); } TypeWorld g = (TypeWorld)Convert.ToInt32(stream.ReadLine()); if (g == TypeWorld.Plains) { this.mIslandLoaded = new RandomIsland(this.getAScenNode(), new Plains(), this); } else if (g == TypeWorld.Desert) { this.mIslandLoaded = new RandomIsland(this.getAScenNode(), new Desert(), this); } else if (g == TypeWorld.Hills) { this.mIslandLoaded = new RandomIsland(this.getAScenNode(), new Hills(), this); } else { this.mIslandLoaded = new RandomIsland(this.getAScenNode(), new Mountains(), this); } }
public StateManager() { this.mStateStack = new Stack<State>(); this.mNewStates = new Stack<Type>(); this.mPopRequested = 0; this.GameInfo = new GameInfo(); this.StoryInfo = new StoryEditorInfo(); this.RequestStatePush(typeof(MenuState)); mNewWorld = TypeWorld.Hills; this.SoundPlayer = new SoundPlayer(); this.SoundPlayer.SoundLocationChanged += (o, args) => this.SoundPlayer.PlayLooping(); this.Disposed += this.Shutdown; }
public StateManager() { this.mStateStack = new Stack <State>(); this.mNewStates = new Stack <Type>(); this.mPopRequested = 0; this.GameInfo = new GameInfo(); this.StoryInfo = new StoryEditorInfo(); this.RequestStatePush(typeof(MenuState)); mNewWorld = TypeWorld.Hills; this.SoundPlayer = new SoundPlayer(); this.SoundPlayer.SoundLocationChanged += (o, args) => this.SoundPlayer.PlayLooping(); this.Disposed += this.Shutdown; }
public static void ChangeIsland(TypeWorld newWorld) { mNewWorld = newWorld; StateManager.ChangeIsland(); }