public override void Serialize(NetBuffer buffer) { ByteFlag actionFlag = new ByteFlag(); actionFlag.Set(0, IsFlashlightVisible); actionFlag.Set(1, Reload); actionFlag.Set(2, DropIntel); this.actionFlag.Value = actionFlag; ByteFlag movementFlag = new ByteFlag(); movementFlag.Set(0, IsCrouching); movementFlag.Set(1, IsSprinting); movementFlag.Set(2, IsMoving); movementFlag.Set(3, IsAiming); movementFlag.Set(4, IsGrounded); movementFlag.Set(5, Jump); this.movementFlag.Value = movementFlag; Reload = false; DropIntel = false; Jump = false; base.Serialize(buffer); }
public override void Serialize(NetBuffer buffer) { if (this.stateFlag != null) { ByteFlag stateFlag = new ByteFlag(); stateFlag.Set(0, IsFlashlightOn); stateFlag.Set(1, IsReloading); this.stateFlag.Value = stateFlag; } if (this.movementFlag != null) { ByteFlag movementFlag = new ByteFlag(); movementFlag.Set(0, IsCrouching); movementFlag.Set(1, IsSprinting); movementFlag.Set(2, IsMoving); movementFlag.Set(3, IsAiming); movementFlag.Set(4, IsGrounded); movementFlag.Set(5, IsJumping); this.movementFlag.Value = movementFlag; } base.Serialize(buffer); }
public void SetNeighbors(bool above, bool below, bool left, bool right, bool forward, bool backward) { ByteFlag newFlag = new ByteFlag(); newFlag.Set(0, left); newFlag.Set(1, right); newFlag.Set(2, above); newFlag.Set(3, below); newFlag.Set(4, forward); newFlag.Set(5, backward); byte nCount = 0; if (above) { nCount++; } if (below) { nCount++; } if (left) { nCount++; } if (right) { nCount++; } if (forward) { nCount++; } if (backward) { nCount++; } neighborFlags = newFlag; NeighborCount = nCount; }