public override void Serialize(System.IO.Stream stream, bool read) { if (read) { System.IO.BinaryReader r = new System.IO.BinaryReader(stream); SerializeOrient(stream, read); op_type = (TBoolOpType)r.ReadUInt32(); int op_count = r.ReadInt32(); for (int i = 0; i < op_count; i++) { TCSGObjectType type = (TCSGObjectType)r.ReadUInt32(); TCSGObject obj = CreateObj(type); obj.Serialize(stream, true); AddOperand(obj); } need_update = true; } else { System.IO.BinaryWriter r = new System.IO.BinaryWriter(stream); r.Write((UInt32)TCSGObjectType.BOOL_OP); SerializeOrient(stream, read); r.Write((UInt32)op_type); r.Write(operand.Count); for (int i = 0; i < operand.Count; i++) { operand[i].Serialize(stream, false); } } }
public void SetRight(TCSGObject use_right) { right = use_right; }
public void SetLeft(TCSGObject use_left) { left = use_left; }
public TCSGOpNot(TCSGObject use_parent) : base(use_parent) { }
public void RemoveOperand(TCSGObject use_op) { operand.Remove(use_op); need_update = true; }
public void InsertOperand(TCSGObject insert_before, TCSGObject use_op) { int index = operand.IndexOf(insert_before); operand.Insert(index, use_op); }
public void AddOperand(TCSGObject use_op) { operand.Add(use_op); need_update = true; }