Example #1
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public BEPUPhysicsManager(IManagerServiceProvider sceneInterface)
 {
     _sceneInterface     = sceneInterface;
     ManagerProcessOrder = 10;
     Space = new Space();
     UseInternalTimeStepping = false;
 }
Example #2
0
        /// <summary>
        ///   Creates a new CameraManager instance
        /// </summary>
        public CameraManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;
            
            // We reset the CameraManager
            Clear();

            ManagerProcessOrder = 60;
        }
Example #3
0
        /// <summary>
        ///   Creates a new CameraManager instance
        /// </summary>
        public CameraManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;

            // We reset the CameraManager
            Clear();

            ManagerProcessOrder = 60;
        }
Example #4
0
        public IndieCityManager(string gameId, string serviceId, string serviceSecret, bool hasAchievements, bool hasLeaderboards, IManagerServiceProvider serviceProvider, SessionEndDelegate sessionEndDelegate)
        {
            _sceneInterface     = serviceProvider;
            _sessionEndDelegate = sessionEndDelegate;

            ManagerProcessOrder = 10;

            var service = new ServiceId
            {
                Data1 = uint.Parse(serviceId.Substring(0, 8), NumberStyles.HexNumber),
                Data2 = ushort.Parse(serviceId.Substring(9, 4), NumberStyles.HexNumber),
                Data3 = ushort.Parse(serviceId.Substring(14, 4), NumberStyles.HexNumber),
                Data4 = new[]
                {
                    byte.Parse(serviceId.Substring(19, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(21, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(24, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(26, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(28, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(30, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(32, 2), NumberStyles.HexNumber),
                    byte.Parse(serviceId.Substring(34, 2), NumberStyles.HexNumber)
                }
            };

            var bridge = new CoBridge2();

            bridge.Initialise(gameId);
            bridge.SetServiceCredentials(GameService.GameService_IndieCityLeaderboardsAndAchievements, service, serviceSecret);

            Session        = bridge.CreateDefaultGameSession();
            _sessionCookie = Session.RegisterEventHandler(0, 0, this);
            _sessionActive = false;
            _startPhase    = SessionStartPhase.NotStarted;

            _username = bridge.UserStore.GetUserFromId(Session.UserId).Name;

            _achievementsReady = !hasAchievements;
            if (hasAchievements)
            {
                AchievementsManager = new CoAchievementManager();
                AchievementsManager.SetGameSession(Session);
                AchievementsManager.InitialiseAchievements(null);
                _achievementsCookie = ((IAchievementService)AchievementsManager).RegisterAchievementEventHandler(this);
                _achievementsUnlockedAtIndieCity = new Dictionary <long, bool>();
            }

            _leaderboardsReady = !hasLeaderboards;
            if (hasLeaderboards)
            {
                _leaderboardsManager = new CoLeaderboardManager();
                _leaderboardsManager.SetGameSession(Session);
                _leaderboardsManager.InitialiseLeaderboards(null);
                _leaderboardsCookie = ((ILeaderboardService)_leaderboardsManager).RegisterLeaderboardEventHandler(this);
            }
        }
Example #5
0
        public IndieCityManager(string gameId, string serviceId, string serviceSecret, bool hasAchievements, bool hasLeaderboards, IManagerServiceProvider serviceProvider, SessionEndDelegate sessionEndDelegate)
        {
            _sceneInterface = serviceProvider;
            _sessionEndDelegate = sessionEndDelegate;

            ManagerProcessOrder = 10;

            var service = new ServiceId
                              {
                                  Data1 = uint.Parse(serviceId.Substring(0, 8), NumberStyles.HexNumber),
                                  Data2 = ushort.Parse(serviceId.Substring(9, 4), NumberStyles.HexNumber),
                                  Data3 = ushort.Parse(serviceId.Substring(14, 4), NumberStyles.HexNumber),
                                  Data4 = new[]
                                              {
                                                  byte.Parse(serviceId.Substring(19, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(21, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(24, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(26, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(28, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(30, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(32, 2), NumberStyles.HexNumber),
                                                  byte.Parse(serviceId.Substring(34, 2), NumberStyles.HexNumber)
                                              }
                              };

            var bridge = new CoBridge2();
            bridge.Initialise(gameId);
            bridge.SetServiceCredentials(GameService.GameService_IndieCityLeaderboardsAndAchievements, service, serviceSecret);

            Session = bridge.CreateDefaultGameSession();
            _sessionCookie = Session.RegisterEventHandler(0, 0, this);
            _sessionActive = false;
            _startPhase = SessionStartPhase.NotStarted;

            _username = bridge.UserStore.GetUserFromId(Session.UserId).Name;

            _achievementsReady = !hasAchievements;
            if (hasAchievements)
            {
                AchievementsManager = new CoAchievementManager();
                AchievementsManager.SetGameSession(Session);
                AchievementsManager.InitialiseAchievements(null);
                _achievementsCookie = ((IAchievementService) AchievementsManager).RegisterAchievementEventHandler(this);
                _achievementsUnlockedAtIndieCity = new Dictionary<long, bool>();
            }

            _leaderboardsReady = !hasLeaderboards;
            if (hasLeaderboards)
            {
                _leaderboardsManager = new CoLeaderboardManager();
                _leaderboardsManager.SetGameSession(Session);
                _leaderboardsManager.InitialiseLeaderboards(null);
                _leaderboardsCookie = ((ILeaderboardService) _leaderboardsManager).RegisterLeaderboardEventHandler(this);
            }
        }
Example #6
0
        /// <summary>
        /// Creates a new instance
        /// </summary>
        public GuiManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;
            
            // we retrieve the SunBurn RenderManager instance process order and set ours adding 2 to it so it always renders after the SunBurn and Custom rendering pipelines
            ManagerProcessOrder = 15;

            // we create an empty list of Screens ready to receive our screens
            _screens = new List<Screen>();

            // we create the SpriteBatch that will be used to render screens and all its inner controls
            _spriteRenderer = new SpriteBatch(SunBurnCoreSystem.Instance.GraphicsDeviceManager.GraphicsDevice);
        }
Example #7
0
        /// <summary>
        /// Creates a new instance
        /// </summary>
        public GuiManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;

            // we retrieve the SunBurn RenderManager instance process order and set ours adding 2 to it so it always renders after the SunBurn and Custom rendering pipelines
            ManagerProcessOrder = 15;

            // we create an empty list of Screens ready to receive our screens
            _screens = new List <Screen>();

            // we create the SpriteBatch that will be used to render screens and all its inner controls
            _spriteRenderer = new SpriteBatch(SunBurnCoreSystem.Instance.GraphicsDeviceManager.GraphicsDevice);
        }
Example #8
0
        public BEPUPhysicsRenderer(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface     = sceneInterface;
            ManagerProcessOrder = 100;

            ModelDrawer            = new InstancedModelDrawer(Application.Instance);
            ContactDrawer          = new ContactDrawer(Application.Instance);
            BoundingBoxDrawer      = new BoundingBoxDrawer(Application.Instance);
            SimulationIslandDrawer = new SimulationIslandDrawer(Application.Instance);

            LineDrawer = new BasicEffect(Application.Graphics.GraphicsDevice);

            Visible = true;
        }
Example #9
0
        /// <summary>
        /// Creates a new instance
        /// </summary>
        public ParticleSystemManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;

            ManagerProcessOrder = 100;

            Renderer = new QuadRenderer()
            {
                GraphicsDeviceService = GraphicsDeviceManager,
            };

            Renderer.LoadContent(Application.ContentManager);

            _activeParticles = SystemConsole.GetStatistic("ParticleSystem_ActiveParticles", SystemStatisticCategory.Rendering);
        }
Example #10
0
        /// <summary>
        /// Creates a new instance
        /// </summary>
        public ParticleSystemManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;

            ManagerProcessOrder = 100;

            Renderer = new QuadRenderer()
                            {
                                GraphicsDeviceService = GraphicsDeviceManager,
                            };

            Renderer.LoadContent(Application.ContentManager);

            _activeParticles = SystemConsole.GetStatistic("ParticleSystem_ActiveParticles", SystemStatisticCategory.Rendering);
        }
Example #11
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public LidgrenSessionManager(IManagerServiceProvider sceneInterface) : base(sceneInterface)
 {
 }
Example #12
0
 public InstancingManager(IManagerServiceProvider sceneInterface)
 {
     _sceneInterface = sceneInterface;
 }
Example #13
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public SpriteObjectManager(IManagerServiceProvider sceneInterface) : base(sceneInterface)
 {
 }
Example #14
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 protected SessionManager(IManagerServiceProvider sceneInterface)
 {
     _sceneInterface     = sceneInterface;
     ManagerProcessOrder = 20;
 }
Example #15
0
 public InstancingManager(IManagerServiceProvider sceneInterface)
 {
     _sceneInterface = sceneInterface;
 }
Example #16
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 protected SessionManager(IManagerServiceProvider sceneInterface)
 {
     _sceneInterface = sceneInterface;
     ManagerProcessOrder = 20;
 }
Example #17
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public LocalSessionManager(IManagerServiceProvider sceneInterface) : base(sceneInterface)
 {
 }