示例#1
0
        public MindBuilder(IAIMgr pMgr)
        {
            //constructor code
            //initalise all instance variables
            _mAIMgr = pMgr;

            _mAIFactory = new AIFactory();

            _idCounter = 0;
        }
示例#2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            //screen width and height

            ScreenHeight = GraphicsDevice.Viewport.Height;
            ScreenWidth  = GraphicsDevice.Viewport.Width;
            //_mSceneMgr
            _mSceneMgr = new SceneMgr();

            //_mEntityMgr
            _mEntityMgr = new EntityMgr(Content);

            //_mEntArray
            _mEntArray = new List <IEntity>();

            //_mCollisionMgr
            _mCollisionMgr = new CollisionMgr();

            //_mAIMgr
            _mAIMgr = new AIMgr();

            //_mMindBuilder
            _mMindBuilder = new MindBuilder(_mAIMgr);

            //_mInputMgr
            _mInputMgr = new InputMgr();

            //_mRenderMgr
            _mRenderMgr = new RenderMgr(Content, GraphicsDevice);

            //_mViewMgr
            _mViewMgr = new ViewportMgr();

            //_mCamera
            _mCamera = new Camera();

            //_mLevel
            _mLevel = new Level2();
            base.Initialize();

            graphics.PreferredBackBufferHeight = ScreenHeight / 2;
            graphics.PreferredBackBufferWidth  = ScreenWidth / 2;
        }