Inheritance: RemoteActuator
Exemple #1
0
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
        {



            IConstrain constrain = null;
            Tile targetTile = null;
            Texture2D decoration = null;
            context.PrepareActuatorData(matchedSequence[0], out targetTile, out constrain, out decoration, putOnWall: false);

            var res = new FloorActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile,
                new OrConstrain(new IConstrain[] { new PartyConstrain(), new TypeConstrain(typeof(Creature)), new TypeConstrain(typeof(GrabableItem)) }),
                targetTile.ToEnumerable(), matchedSequence[0].GetActionStateX().ToEnumerable());

            //TODO 14 28 actuator sends Clear message to pit(which open the pit => should be close) 
            res.Graphics = new CubeGraphic
            {
                Position = res.Position,
                DrawFaces = CubeFaces.All,
                Outter = true,
                Scale = new Vector3(0.2f),
                Texture = decoration
            };
            return res;
        }
        public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence)
        {

            IConstrain constrain = null;
            if (matchedSequence[0].Data == 0)
                constrain = new PartyConstrain();
            else
                constrain = new PartDirectionConstrain((MapDirection)(matchedSequence[0].Data - 1));

            var res = new FloorActuator(context.GetFloorPosition(matchedSequence[0].TilePosition, currentTile), currentTile, constrain,
                matchedSequence.Select(context.GetTargetTile), matchedSequence.Select(x => x.GetActionStateX()));

            res.Graphics = new CubeGraphic
            {
                Position = res.Position,
                DrawFaces = CubeFaces.All,
                Outter = true,
                Scale = new Vector3(0.2f),
                Texture = context.GetTexture(matchedSequence.First(), putOnWall:false) 
            };
            return res;
        }