public override int WriteTo(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.WriteTo(Buffer, cursor); cursor += SectorChange.WriteTo(Buffer, cursor); return(cursor - StartIndex); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.ReadFrom(Buffer, cursor); SectorChange = new SectorChange(Buffer, cursor); cursor += SectorChange.ByteLength; return(cursor - StartIndex); }
/// <summary> /// Applies SectorChange information on this sector /// </summary> /// <param name="SectorChange"></param> public void ApplyChange(SectorChange SectorChange) { // update depth if (SectorChange.Depth != RooSectorFlags.DepthType.ChangeOverride) { Flags.SectorDepth = SectorChange.Depth; } // update scrollspeed if (SectorChange.ScrollSpeed != TextureScrollSpeed.CHANGE_OVERRIDE) { Flags.ScrollSpeed = SectorChange.ScrollSpeed; } // update additional values based on scrollspeed and raise TextureChanged SetFloorTexture(FloorTexture, ResourceFloor); SetCeilingTexture(CeilingTexture, ResourceCeiling); }
public SectorChangeMessage(SectorChange SectorChange) : base(MessageTypeGameMode.SectorChange) { this.SectorChange = SectorChange; }