예제 #1
0
파일: VirusBoard.cs 프로젝트: Armienn/Virus
        public void Load(string save)
        {
            NeaReader reader = new NeaReader(save);

            sx = reader.ReadInt();
            sy = reader.ReadInt();
            ex = reader.ReadInt();
            ey = reader.ReadInt();
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
		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;
		}
예제 #5
0
		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;
		}