예제 #1
0
        public static Vec2Float ReadFrom(BinaryReader reader)
        {
            var result = new Vec2Float();

            result.X = reader.ReadSingle();
            result.Y = reader.ReadSingle();
            return(result);
        }
예제 #2
0
 public Camera(Vec2Float center, float rotation, float attack, float distance, bool perspective)
 {
     Center      = center;
     Rotation    = rotation;
     Attack      = attack;
     Distance    = distance;
     Perspective = perspective;
 }
예제 #3
0
 public DebugState(Vec2Int windowSize, Vec2Float mousePosWindow, Vec2Float mousePosWorld, string[] pressedKeys, Camera camera, int playerIndex)
 {
     WindowSize     = windowSize;
     MousePosWindow = mousePosWindow;
     MousePosWorld  = mousePosWorld;
     PressedKeys    = pressedKeys;
     Camera         = camera;
     PlayerIndex    = playerIndex;
 }
예제 #4
0
        public static Camera ReadFrom(BinaryReader reader)
        {
            var result = new Camera();

            result.Center      = Vec2Float.ReadFrom(reader);
            result.Rotation    = reader.ReadSingle();
            result.Attack      = reader.ReadSingle();
            result.Distance    = reader.ReadSingle();
            result.Perspective = reader.ReadBoolean();
            return(result);
        }
예제 #5
0
        public static DebugState ReadFrom(BinaryReader reader)
        {
            var result = new DebugState();

            result.WindowSize     = Vec2Int.ReadFrom(reader);
            result.MousePosWindow = Vec2Float.ReadFrom(reader);
            result.MousePosWorld  = Vec2Float.ReadFrom(reader);
            result.PressedKeys    = new string[reader.ReadInt32()];
            for (int i = 0; i < result.PressedKeys.Length; i++)
            {
                result.PressedKeys[i] = Encoding.UTF8.GetString(reader.ReadBytes(reader.ReadInt32()));
            }

            result.Camera      = Camera.ReadFrom(reader);
            result.PlayerIndex = reader.ReadInt32();
            return(result);
        }
예제 #6
0
        public static ColoredVertex ReadFrom(BinaryReader reader)
        {
            var result = new ColoredVertex();

            if (reader.ReadBoolean())
            {
                result.WorldPos = Vec2Float.ReadFrom(reader);
            }
            else
            {
                result.WorldPos = null;
            }

            result.ScreenOffset = Vec2Float.ReadFrom(reader);
            result.Color        = Color.ReadFrom(reader);
            return(result);
        }
예제 #7
0
 public ColoredVertex(Vec2Float?worldPos, Vec2Float screenOffset, Color color)
 {
     WorldPos     = worldPos;
     ScreenOffset = screenOffset;
     Color        = color;
 }