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