Beispiel #1
0
        /// <summary>
        /// Call this to initialize a Behaviour with data supplied in a file.
        /// </summary>
        /// <param name="fileName">The file to load from.</param>
        public override void LoadContent(String fileName)
        {
            base.LoadContent(fileName);

            ObjectPlacementDefinition def = GameObjectManager.pInstance.pContentManager.Load <ObjectPlacementDefinition>(fileName);

            mCursor           = new GameObject("GameObjects\\Interface\\PlacementCursor\\PlacementCursor");
            mCursor.pPosition = mParentGOH.pPosition;
            GameObjectManager.pInstance.Add(mCursor);

            mCursorOffset = Vector2.Zero;

            mItemOffset     = new Vector2(-4, -4);
            mItemSourceRect = new Rectangle(0, 0, 8, 8);
            mItemColor      = new Color(255, 255, 255, 200);

            mAbsOffsetRange = def.mAbsOffsetRange;

            mRemoveClassifications = new List <MBHEngineContentDefs.GameObjectDefinition.Classifications>(1);
            mRemoveClassifications.Add(MBHEngineContentDefs.GameObjectDefinition.Classifications.WALL);

            mGetTileAtPositionMsg     = new Level.GetTileAtPositionMessage();
            mGetMapInfoMsg            = new Level.GetMapInfoMessage();
            mSetTileTypeAtPositionMsg = new Level.SetTileTypeAtPositionMessage();
            mGetCurrentObjectMsg      = new Inventory.GetCurrentObjectMessage();
            mOnPlaceObjectMsg         = new OnPlaceObjectMessage();
            mAddObjectMsg             = new Inventory.AddObjectMessage();
            mSelectNextItemMsg        = new Inventory.SelectNextItemMessage();
            mGetTexture2DMsg          = new SpriteRender.GetTexture2DMessage();
            mPeekCurrentObjectMsg     = new Inventory.PeekCurrentObjectMessage();
        }
Beispiel #2
0
        /// <summary>
        /// Call this to initialize a Behaviour with data supplied in a file.
        /// </summary>
        /// <param name="fileName">The file to load from.</param>
        public override void LoadContent(String fileName)
        {
            base.LoadContent(fileName);

            PickupDefinition def = GameObjectManager.pInstance.pContentManager.Load <PickupDefinition>(fileName);

            mInventoryTemplateFileName = def.mInventoryTemplateFileName;

            mAddObjectMsg = new Inventory.AddObjectMessage();
        }