コード例 #1
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;
        }
コード例 #2
0
ファイル: TDLFactory.cs プロジェクト: SuperV1234/TimeDRODPOF
        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;
        }
コード例 #3
0
ファイル: TDLFactory.cs プロジェクト: SuperV1234/TimeDRODPOF
        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;
        }