Exemplo n.º 1
0
 public void WriteType(NetOutgoingMessage Message, AttributeTypeID Type, object Data)
 {
     switch (Type) {
         case AttributeTypeID.Float:
             Message.Write((float)Data);
             break;
         case AttributeTypeID.Int:
             Message.Write((int)Data);
             break;
         case AttributeTypeID.List:
             Console.WriteLine("Engine unable to serialize list objects");
             break;
         case AttributeTypeID.Long:
             Message.Write((long)Data);
             break;
         case AttributeTypeID.Rectangle:
             Message.WriteRectangle((Rectangle)Data);
             break;
         case AttributeTypeID.String:
             Message.Write((string)Data);
             break;
         case AttributeTypeID.Vector2:
             Message.WriteVector2((Vector2)Data);
             break;
         case AttributeTypeID.Bool:
             Message.Write((bool)Data);
             break;
         default:
             Console.WriteLine("AttributeSystem Unrecognised Type In AttributeSystem Type: {0}", Type.ToString());
             break;
     }
 }