Example #1
0
        public GameStateManager(GraphicsDeviceManager man, ContentManager cman, MineWorldClient gam)
        {
            Audiomanager = new AudioManager();
            Config       = new ConfigFile("data/settings.ini");
            _inputhelper = new InputHelper();
            Game         = gam;
            Conmanager   = cman;
            Graphics     = man;
            Device       = Graphics.GraphicsDevice;
            SpriteBatch  = new SpriteBatch(Device);
            _screens     = new BaseState[]
            {
                new TitleState(this, GameState.TitleState),
                new MainMenuState(this, GameState.MainMenuState),
                new LoadingState(this, GameState.LoadingState),
                new MainGameState(this, GameState.MainGameState),
                new SettingsState(this, GameState.SettingsState),
                _serverbrowsingstate = new ServerBrowsingState(this, GameState.ServerBrowsingState),
                _errorstate          = new ErrorState(this, GameState.ErrorState)
            };
            //curScreen = titlestate;
            Pbag = new PropertyBag(gam, this);

            //Set initial state in the manager itself
            SwitchState(GameState.TitleState);
        }
Example #2
0
        public GameStateManager(GraphicsDeviceManager man,ContentManager cman,MineWorldClient gam)
        {
            Audiomanager = new AudioManager();
            Config = new ConfigFile("data/settings.ini");
            _inputhelper = new InputHelper();
            Game = gam;
            Conmanager = cman;
            Graphics = man;
            Device = Graphics.GraphicsDevice;
            SpriteBatch = new SpriteBatch(Device);
            _screens = new BaseState[]
                           {
                               new TitleState(this, GameState.TitleState),
                               new MainMenuState(this, GameState.MainMenuState),
                               new LoadingState(this, GameState.LoadingState),
                               new MainGameState(this, GameState.MainGameState),
                               new SettingsState(this, GameState.SettingsState),
                               _serverbrowsingstate = new ServerBrowsingState(this, GameState.ServerBrowsingState),
                               _errorstate = new ErrorState(this, GameState.ErrorState)
                           };
            //curScreen = titlestate;
            Pbag = new PropertyBag(gam,this);

            //Set initial state in the manager itself
            SwitchState(GameState.TitleState);
        }
Example #3
0
 public PropertyBag(MineWorldClient gamein,GameStateManager gameManagerin)
 {
     Game = gamein;
     GameManager = gameManagerin;
     NetPeerConfiguration netconfig = new NetPeerConfiguration("MineWorld");
     netconfig.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);
     Client = new NetClient(netconfig);
     Client.Start();
     Player = new Player(this);
     WorldManager = new WorldManager(GameManager, Player);
     ClientListener = new ClientListener(Client, this);
     ClientSender = new ClientSender(Client, this);
     Debugger = new Debug(this);
 }
Example #4
0
        public PropertyBag(MineWorldClient gamein, GameStateManager gameManagerin)
        {
            Game        = gamein;
            GameManager = gameManagerin;
            NetPeerConfiguration netconfig = new NetPeerConfiguration("MineWorld");

            netconfig.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);
            Client = new NetClient(netconfig);
            Client.Start();
            Player         = new Player(this);
            WorldManager   = new WorldManager(GameManager, Player);
            ClientListener = new ClientListener(Client, this);
            ClientSender   = new ClientSender(Client, this);
            Debugger       = new Debug(this);
        }