Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public static void ChangeIsland(TypeWorld newWorld)
 {
     mNewWorld = newWorld;
     StateManager.ChangeIsland();
 }
Exemplo n.º 5
0
 public static void ChangeIsland(TypeWorld newWorld)
 {
     mNewWorld = newWorld;
     StateManager.ChangeIsland();
 }