/// <summary> /// Collision Detector /// </summary> /// <param name="_em">Reference to Entity Manager</param> /// <param name="_screenSize">Size of game viewport</param> public Collision_Manager(IEntity_Manager _em) { mCollidables = new Dictionary <int, ICollidable>(); mEntityManager = _em; mQuadtree = new Quadtree(0, new Rectangle(Global.Camera.Position.ToPoint(), new Point(Global.Camera.ViewPortWidth, Global.Camera.ViewPortHeight))); //mQuadtree = new Quadtree(0, new Rectangle(new Point (0,0), new Point(5000,5000))); }
/// <summary> /// Main Constructor /// </summary> /// <param name="_sl">Reference to the Service Locator</param> /// <param name="_em">Reference to the Entity Manager</param> /// <param name="_levels">Pass all Loaded levels here</param> public Level_Manager(IServiceLocator _sl, IEntity_Manager _em, IDictionary <string, ILevel> _levels) { mServiceLocator = _sl; mEntityManager = _em; mLevels = _levels; mLoadedLevels = new Dictionary <string, ILevel>(); mServiceLocator.GetService <IInput_Manager>().SubCheats(LevelSkip); }
//StorageDevice device; //string containerName = "GMTBSaveData"; //string filename = "InfirmarySave.sav"; #endregion #region Accessors //public IDictionary<int, IEntity> Entities //{ // get { return mEntities; } //} //public IDictionary<int, IEntity> SceneGraph //{ // get { return mSceneGraph; } //} #endregion #region Constructor /// <summary> /// Main Constructor /// </summary> /// <param name="_em">Reference to the Entity Manager</param> /// <param name="_bm">Reference to the Background manager</param> public Scene_Manager(IEntity_Manager _em, IBackground_Manager _bm) { // Initialise Entity List //mEntities = em.Entities; mEntityManager = _em; mBackgroundManager = _bm; mSceneGraph = new Dictionary <int, IPhysicalEntity>(); mEntities = new Dictionary <int, IEntity>(); }
/// <summary> /// Allows the Menu to initialize itself /// Sets up references to the managers and camera /// </summary> /// <param name="_sl">Reference to the service locator</param> /// <param name="_cam">Reference to the 2D Camera</param> public virtual void Initialize(IServiceLocator _sl, Camera2D _cam) { mServiceLocator = _sl; mInputManager = mServiceLocator.GetService <IInput_Manager>(); mBackgroundManager = mServiceLocator.GetService <IBackground_Manager>(); mEntityManager = mServiceLocator.GetService <IEntity_Manager>(); mContentManager = mServiceLocator.GetService <IContent_Manager>(); mLevelManger = mServiceLocator.GetService <ILevel_Manager>(); mCam = _cam; //Subscribe(); }
/// <summary> /// Initialises the level, sets up Manager references /// Then Resumes the level if not already run /// </summary> /// <param name="_sl"> Reference to the Service Locator </param> public virtual void Initialise(IServiceLocator _sl) { mServiceLocator = _sl; mEntityManager = mServiceLocator.GetService <IEntity_Manager>(); mSceneManager = mServiceLocator.GetService <IScene_Manager>(); mBackgroundManager = mServiceLocator.GetService <IBackground_Manager>(); if (!firstRun) { Resume(); } }
/// <summary> /// Main Constructor /// </summary> /// <param name="_em">Reference to the Entity Manager</param> public AI_Manager(IEntity_Manager _em, ILevel_Manager _lm) { mEntityManager = _em; mLevelManager = _lm; mAllAI = new Dictionary <int, IBasicAI>(); }
/// <summary> /// Set core variables /// </summary> /// <param name="_sl">Reference to Service Locator</param> public void setVars(IServiceLocator _sl) { mEntityManager = _sl.GetService <IEntity_Manager>(); mSceneManager = _sl.GetService <IScene_Manager>(); }
/// <summary> /// Set UID /// </summary> /// <param name="_uid"> Unique ID </param> /// <param name="_sl"> Reference to the Service Locator </param> public virtual void setVars(int _uid, IServiceLocator _sl) { mUID = _uid; mServiceLocator = _sl; mEntityManger = mServiceLocator.GetService <IEntity_Manager>(); }