Exemplo n.º 1
0
        public static PlayerMessageGame ReadFrom(System.IO.BinaryReader reader)
        {
            switch (reader.ReadInt32())
            {
            case CustomDataMessage.TAG:
                return(CustomDataMessage.ReadFrom(reader));

            case ActionMessage.TAG:
                return(ActionMessage.ReadFrom(reader));

            default:
                throw new System.Exception("Unexpected discriminant value");
            }
        }
Exemplo n.º 2
0
        public static PlayerMessage ReadFrom(System.IO.BinaryReader reader)
        {
            if (reader == null)
            {
                throw new System.ArgumentNullException(nameof(reader));
            }

            switch (reader.ReadInt32())
            {
            case DebugMessage.TAG:
                return(DebugMessage.ReadFrom(reader));

            case ActionMessage.TAG:
                return(ActionMessage.ReadFrom(reader));

            default:
                throw new System.Exception("Unexpected discriminant value");
            }
        }
Exemplo n.º 3
0
        public static ClientMessage ReadFrom(System.IO.BinaryReader reader)
        {
            switch (reader.ReadInt32())
            {
            case DebugMessage.TAG:
                return(DebugMessage.ReadFrom(reader));

            case ActionMessage.TAG:
                return(ActionMessage.ReadFrom(reader));

            case DebugUpdateDone.TAG:
                return(DebugUpdateDone.ReadFrom(reader));

            case RequestDebugState.TAG:
                return(RequestDebugState.ReadFrom(reader));

            default:
                throw new System.Exception("Unexpected tag value");
            }
        }