Beispiel #1
0
 public void Deserialize(BinaryReader reader)
 {
     Type = (VMCommandType)reader.ReadByte();
     Type cmdType = CmdMap[Type];
     Command = (VMNetCommandBodyAbstract)Activator.CreateInstance(cmdType);
     Command.Deserialize(reader);
 }
        public void Deserialize(BinaryReader reader)
        {
            Type = (VMCommandType)reader.ReadByte();
            Type cmdType = CmdMap[Type];

            Command = (VMNetCommandBodyAbstract)Activator.CreateInstance(cmdType);
            Command.Deserialize(reader);
        }
Beispiel #3
0
        public bool TryDeserialize(BinaryReader reader, bool isClient)
        {
            Type = (VMCommandType)reader.ReadByte();
            Type cmdType = CmdMap[Type];

            Command = (VMNetCommandBodyAbstract)Activator.CreateInstance(cmdType);
            if (Command.AcceptFromClient || isClient)
            {
                Command.Deserialize(reader);
                return(true);
            }
            return(false);
        }
Beispiel #4
0
 public void SetCommand(VMNetCommandBodyAbstract cmd)
 {
     Type    = ReverseMap[cmd.GetType()];
     Command = cmd;
 }
Beispiel #5
0
 public void SetCommand(VMNetCommandBodyAbstract cmd)
 {
     Type = ReverseMap[cmd.GetType()];
     Command = cmd;
 }