Example #1
0
    public static Vec2 Deserialize(byte[] bytes)
    {
        var playObj = CodecUtils.DeserializePlayObject(bytes);

        return(new Vec2 {
            X = playObj.GetFloat("x"),
            Y = playObj.GetFloat("y")
        });
    }
Example #2
0
    public static Move Deserialize(byte[] bytes)
    {
        var playObj = CodecUtils.DeserializePlayObject(bytes);

        return(new Move {
            Pos = playObj.Get <Vec2>("p"),
            Dir = playObj.Get <Vec2>("d"),
            Time = playObj.GetLong("t")
        });
    }
Example #3
0
    public static Food Deserialize(byte[] bytes)
    {
        var playObj = CodecUtils.DeserializePlayObject(bytes);
        var food    = new Food {
            Id   = playObj.GetInt("id"),
            Type = playObj.GetInt("type"),
            X    = playObj.GetFloat("x"),
            Y    = playObj.GetFloat("y")
        };

        return(food);
    }