Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using ProtoBuf;
- using System;
- using System.Collections.Generic;
- namespace DataModels
- {
- [ProtoContract]
- public class EntityState
- {
- [ProtoMember(1)]
- public int id;
- [ProtoMember(2)]
- public string name;
- [ProtoMember(3)]
- public float hp;
- [ProtoMember(4)]
- public MyVector3 position;
- [ProtoMember(5)]
- public MyQuaternion rotation;
- }
- [ProtoContract]
- public class EntityStateList
- {
- [ProtoMember(1)]
- public Dictionary<int, EntityState> serializableItems;
- }
- [ProtoContract]
- public class MyVector3
- {
- [ProtoMember(1)]
- public float x;
- [ProtoMember(2)]
- public float y;
- [ProtoMember(3)]
- public float z;
- public MyVector3()
- {
- this.x = 0f;
- this.y = 0f;
- this.z = 0f;
- }
- public MyVector3(float x, float y, float z)
- {
- this.x = x;
- this.y = y;
- this.z = z;
- }
- }
- [ProtoContract]
- public class MyQuaternion
- {
- [ProtoMember(1)]
- public float x;
- [ProtoMember(2)]
- public float y;
- [ProtoMember(3)]
- public float z;
- [ProtoMember(4)]
- public float w;
- public MyQuaternion()
- {
- this.x = 0f;
- this.y = 0f;
- this.z = 0f;
- this.w = 0f;
- }
- public MyQuaternion(float x, float y, float z, float w)
- {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement