Ejemplo n.º 1
0
        public TDCOrthogonalSquare(TDCSpecialSquare mSpecialSquareComponent, TDCSwitch mSwitchComponent)
        {
            _switchComponent = mSwitchComponent;

            mSpecialSquareComponent.OnMoveFromAllowed += SpecialSquareMove;
            mSpecialSquareComponent.OnMoveToAllowed += SpecialSquareMove;
        }
 public TDCSwitchRecalculateTagAI(TDCSwitch mSwitchComponent, TDCRecalculateSprites mRecalculateComponent, string mOffTag, string mOnTag)
 {
     _switchComponent = mSwitchComponent;
     _recalculateComponent = mRecalculateComponent;
     OffTag = mOffTag;
     OnTag = mOnTag;
 }
Ejemplo n.º 3
0
        public TDCTrapdoor(bool mIsOnWater, bool mIsBroken, TDCSpecialSquare mSpecialSquareComponent, TDCSwitch mSwitchComponent)
        {
            _isOnWater = mIsOnWater;
            _isBroken = mIsBroken;
            _switchComponent = mSwitchComponent;

            mSpecialSquareComponent.OnMoveFromAllowed += SpecialSquareMove;
        }
Ejemplo n.º 4
0
        public TDCBooster(TDCDirection mDirectionComponent, TDCSwitch mSwitchComponent, TDCSpecialSquare mSpecialSquareComponent)
        {
            _directionComponent = mDirectionComponent;
            _switchComponent = mSwitchComponent;
            _specialSquareComponent = mSpecialSquareComponent;

            _specialSquareComponent.OnMoveFromAllowed += SpecialSquareFrom;
        }
Ejemplo n.º 5
0
        public TDCArrow(TDCSpecialSquare mSpecialSquareComponent, TDCDirection mDirectionComponent, TDCSwitch mSwitchComponent)
        {
            _directionComponent = mDirectionComponent;
            _switchComponent = mSwitchComponent;

            mSpecialSquareComponent.OnMoveFromAllowed += SpecialSquareMove;
            mSpecialSquareComponent.OnMoveToAllowed += SpecialSquareMove;
        }
Ejemplo n.º 6
0
        public static TDCSwitch Switch(TDCRender mRenderComponent, bool mIsOff, string mTilesetName = "onofftiles", string mOffLabel = "off", string mOnLabel = "on")
        {
            var result = new TDCSwitch(mRenderComponent, mIsOff);

            result.SetOffTextureRect(Assets.GetTileset(mTilesetName).GetTextureRect(mOffLabel));
            result.SetOnTextureRect(Assets.GetTileset(mTilesetName).GetTextureRect(mOnLabel));

            return result;
        }
Ejemplo n.º 7
0
        public TDCDoor(DoorType mDoorType, bool mIsOff, TDGGame mGame, TDCSwitch mSwitchComponent, TDCRecalculateSprites mRecalculateSprites)
        {
            _doorType = mDoorType;

            _game = mGame;
            _isOff = mIsOff;

            _switchComponent = mSwitchComponent;
            _recalculateSpritesComponent = mRecalculateSprites;

            _switchComponent.OnTurnOff += SetRecalculationNeeded;
            _switchComponent.OnTurnOn += SetRecalculationNeeded;
        }
Ejemplo n.º 8
0
        public static Entity Arrow(int mDirection = 0, bool mIsOff = false, List<int> mIDs = default(List<int>))
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow, UpdateOrder = TDLOrders.Trapdoor};

            var cRender = TDLComponentFactory.Render(@"environment\arrow", "onoffdirtiles", "on_n");
            var cDirection = new TDCDirection(mDirection);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Arrow);
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = new TDCSwitch(cRender, mIsOff);
            cSwitch.SetOffTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("off_" + cDirection.DirectionString));
            cSwitch.SetOnTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("on_" + cDirection.DirectionString));
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cArrow = new TDCArrow(cSpecialSquare, cDirection, cSwitch);

            cSwitch.OnlyOnTags.Add(TDLTags.GroundPathmapObstacle);

            result.AddTags(TDLTags.Arrow);
            result.AddComponents(cRender, cDirection, cSpecialSquare, cID, cSwitch, cIDSwitchAI, cArrow);

            return result;
        }
Ejemplo n.º 9
0
 public TDCIDSwitchAI(TDCSwitch mSwitchComponent, TDCID mIDComponent)
 {
     _switchComponent = mSwitchComponent;
     _idComponent = mIDComponent;
 }
Ejemplo n.º 10
0
        public static Entity Booster(int mDirection = 0, bool mIsOff = false, List<int> mIDs = default(List<int>))
        {
            var result = new Entity(Tile) {Layer = TDLLayers.Arrow};

            var cRender = TDLComponentFactory.Render(@"elements\booster", "onoffdirtiles", "on_n");
            var cDirection = new TDCDirection(mDirection);
            var cSpecialSquare = new TDCSpecialSquare(TDLPriorities.Trapdoor);
            var cID = TDLComponentFactory.ID(mIDs);
            var cSwitch = new TDCSwitch(cRender, mIsOff);
            cSwitch.SetOffTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("off_" + cDirection.DirectionString));
            cSwitch.SetOnTextureRect(Assets.GetTileset("onoffdirtiles").GetTextureRect("on_" + cDirection.DirectionString));
            var cIDSwitchAI = new TDCIDSwitchAI(cSwitch, cID);
            var cBooster = new TDCBooster(cDirection, cSwitch, cSpecialSquare);

            result.AddTags(TDLTags.Booster);
            result.AddComponents(cRender, cSpecialSquare, cDirection, cID, cSwitch, cIDSwitchAI, cBooster);

            return result;
        }