public virtual void deserialize(NetIncomingMessage inMsg) { owner = dwObject2D.deserialize(inMsg); targetType = (TargetType)inMsg.ReadByte(); switch (targetType) { case (TargetType.Instant): break; case (TargetType.Point): targetPoint = new dwVector2(); targetPoint.deserialize(inMsg); break; case (TargetType.Object): targetObject = dwObject2D.deserialize(inMsg); break; } }
//Object interaction public void addObject(dwObject2D obj) { if (obj != null) { objects.Add(obj); } }
private void sendOrderToObject(dwObject2D obj, Order issuedOrder) { obj.issueOrder(issuedOrder); }
protected void issueOrder(dwObject2D obj, Order issuedOrder) { sendOrderToObject(obj, issuedOrder); }
public void removeObject(dwObject2D obj) { if (obj != null) { objects.Remove(obj); obj.destroy(); } }
//Order handling public virtual void issueInputOrder(dwObject2D obj, Order issuedOrder) { issuedOrder.owner = obj; currentFrameInput.addOrder(issuedOrder); }