Ejemplo n.º 1
0
        private IList <TeleporterItem> ReadTeleportsData(BinaryReader r)
        {
            var doors = new TeleporterItem[Data.TeleportsCount];

            for (int i = 0; i < Data.TeleportsCount; i++)
            {
                doors[i] = ParseTeleportData(r);
            }

            return(doors);
        }
Ejemplo n.º 2
0
        private TeleporterItem ParseTeleportData(BinaryReader r)
        {
            var t = new TeleporterItem();

            t.NextObjectID = r.ReadUInt16();

            ushort data1 = r.ReadUInt16();

            t.HasSound            = (data1 >> 15) == 1;
            t.Scope               = (TeleportScope)((data1 >> 13) & twoBitsMask);
            t.RotationType        = (RotationType)((data1 >> 12) & oneBitMask);
            t.Rotation            = (Direction)((data1 >> 10) & twoBitsMask);
            t.DestinationPosition = new Position
            {
                Y = (data1 >> 5) & fiveBitsMask,
                X = data1 & fiveBitsMask
            };

            t.MapIndex = (r.ReadUInt16() >> 8) & eightBitsMask;
            return(t);
        }
Ejemplo n.º 3
0
 public IGrabableItem CreateTeleport(TeleporterItem teleport)
 {
     throw new InvalidOperationException("Not supported.");
 }
Ejemplo n.º 4
0
 public ItemData CreateTeleport(TeleporterItem teleport)
 {
     ((TeleporterTileData)currentTile).Teleport = teleport;
     return(teleport);
 }
Ejemplo n.º 5
0
        private TeleporterItem ParseTeleportData(BinaryReader r)
        {
            var t = new TeleporterItem();
            t.NextObjectID = r.ReadUInt16();

            ushort data1 = r.ReadUInt16();

            t.HasSound = (data1 >> 15) == 1;
            t.Scope = (TeleportScope)((data1 >> 13) & twoBitsMask);
            t.RotationType = (RotationType)((data1 >> 12) & oneBitMask);
            t.Rotation = (Direction)((data1 >> 10) & twoBitsMask);
            t.DestinationPosition = new Position
            {
                Y = (data1 >> 5) & fiveBitsMask,
                X = data1 & fiveBitsMask
            };

            t.MapIndex = (r.ReadUInt16() >> 8) & eightBitsMask;
            return t;
        }
Ejemplo n.º 6
0
        private IList<TeleporterItem> ReadTeleportsData(BinaryReader r)
        {
            var doors = new TeleporterItem[Data.TeleportsCount];

            for (int i = 0; i < Data.TeleportsCount; i++)
                doors[i] = ParseTeleportData(r);

            return doors;
        }