Exemplo n.º 1
0
        public static Vec2Float ReadFrom(BinaryReader reader)
        {
            var result = new Vec2Float();

            result.X = reader.ReadSingle();
            result.Y = reader.ReadSingle();
            return(result);
        }
Exemplo n.º 2
0
 public Camera(Vec2Float center, float rotation, float attack, float distance, bool perspective)
 {
     Center      = center;
     Rotation    = rotation;
     Attack      = attack;
     Distance    = distance;
     Perspective = perspective;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
 public ColoredVertex(Vec2Float?worldPos, Vec2Float screenOffset, Color color)
 {
     WorldPos     = worldPos;
     ScreenOffset = screenOffset;
     Color        = color;
 }