public void SetFrom(Bomb b) { active = b.isActive; if (active) { direction = b.direction; px = b.px; py = b.py; speed = b.GetSpeed(); flags = 0; flags |= b.IsJelly() ? FLAG_JELLY : 0; flags |= b.IsTrigger() ? FLAG_TRIGGER : 0; } }
private void WriteBombState(NetBuffer msg, Bomb b) { msg.Write(b.isActive); if (b.isActive) { msg.WriteTime(NetTime.Now + b.timeRemains, false); msg.Write(b.px); msg.Write(b.py); msg.Write((byte)b.direction); msg.Write(b.GetSpeed()); msg.Write(b.IsJelly()); msg.Write(b.IsTrigger()); } }