public void Load(string save) { NeaReader reader = new NeaReader(save); sx = reader.ReadInt(); sy = reader.ReadInt(); ex = reader.ReadInt(); ey = reader.ReadInt(); }
public static bool TryParseGameMessage(string message, out string id, out int x, out int y, out int dx, out int dy) { id = ""; x = y = dx = dy = 0; bool success = InitialMessageCheck(message, MessageType.GameMessage, out message); if (!success) { return(false); } NeaReader reader = new NeaReader(message); try { id = reader.ReadWord(); x = reader.ReadInt(); y = reader.ReadInt(); dx = reader.ReadInt(); dy = reader.ReadInt(); } catch { return(false); } return(true); }
public static bool TryParseReadyMessage(string message, out string id, out bool ready) { id = ""; ready = false; bool success = InitialMessageCheck(message, MessageType.Ready, out message); if (!success) { return(false); } NeaReader reader = new NeaReader(message); try { id = reader.ReadWord(); ready = reader.ReadInt() == 1 ? true : false; } catch { return(false); } return(true); }
public static bool TryParseGameMessage(string message, out string id, out int x, out int y, out int dx, out int dy) { id = ""; x = y = dx = dy = 0; bool success = InitialMessageCheck(message, MessageType.GameMessage, out message); if (!success) return false; NeaReader reader = new NeaReader(message); try { id = reader.ReadWord(); x = reader.ReadInt(); y = reader.ReadInt(); dx = reader.ReadInt(); dy = reader.ReadInt(); } catch { return false; } return true; }
public static bool TryParseReadyMessage(string message, out string id, out bool ready) { id = ""; ready = false; bool success = InitialMessageCheck(message, MessageType.Ready, out message); if (!success) return false; NeaReader reader = new NeaReader(message); try { id = reader.ReadWord(); ready = reader.ReadInt() == 1 ? true : false; } catch { return false; } return true; }