コード例 #1
0
ファイル: Order.cs プロジェクト: jacquesh/deterministicworld
        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;
            }
        }
コード例 #2
0
 //Object interaction
 public void addObject(dwObject2D obj)
 {
     if (obj != null)
     {
         objects.Add(obj);
     }
 }
コード例 #3
0
 private void sendOrderToObject(dwObject2D obj, Order issuedOrder)
 {
     obj.issueOrder(issuedOrder);
 }
コード例 #4
0
 protected void issueOrder(dwObject2D obj, Order issuedOrder)
 {
     sendOrderToObject(obj, issuedOrder);
 }
コード例 #5
0
 public void removeObject(dwObject2D obj)
 {
     if (obj != null)
     {
         objects.Remove(obj);
         obj.destroy();
     }
 }
コード例 #6
0
        //Order handling
        public virtual void issueInputOrder(dwObject2D obj, Order issuedOrder)
        {
            issuedOrder.owner = obj;

            currentFrameInput.addOrder(issuedOrder);
        }