示例#1
0
        public override int WriteTo(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            cursor += base.WriteTo(Buffer, cursor);
            cursor += SectorMove.WriteTo(Buffer, cursor);

            return(cursor - StartIndex);
        }
示例#2
0
        public override int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            cursor += base.ReadFrom(Buffer, cursor);

            SectorMove = new SectorMove(Buffer, cursor);
            cursor    += SectorMove.ByteLength;

            return(cursor - StartIndex);
        }
 /// <summary>
 /// Starts a movement of the sector
 /// </summary>
 /// <param name="SectorMove"></param>
 public void StartMove(SectorMove SectorMove)
 {
     if (SectorMove.Type == AnimationType.FLOORLIFT)
     {
         // set target height and speed for floor
         MoveFloorHeight = (Real)SectorMove.Height;
         MoveFloorSpeed  = SectorMove.Speed;
         IsMovingFloor   = true;
     }
     else if (SectorMove.Type == AnimationType.CEILINGLIFT)
     {
         // set target height and speed for ceiling
         MoveCeilingHeight = (Real)SectorMove.Height;
         MoveCeilingSpeed  = SectorMove.Speed;
         IsMovingCeiling   = true;
     }
 }
示例#4
0
 public SectorMoveMessage(SectorMove SectorMove)
     : base(MessageTypeGameMode.SectorMove)
 {
     this.SectorMove = SectorMove;
 }