Beispiel #1
0
    protected TreeObject(SerializationInfo info, StreamingContext context) : base(info, context)
    {
        type = (TreeType)info.GetValue(KEY_TYPE, typeof(TreeType));
        SerializableMesh sMesh = (SerializableMesh)info.GetValue(KEY_MESH, typeof(SerializableMesh));

        if (sMesh != null)
        {
            mesh = sMesh.toMesh();
        }
    }
Beispiel #2
0
    protected Chunk(SerializationInfo info, StreamingContext context)
    {
        if (info == null)
        {
            throw new ArgumentNullException("info");
        }
        x         = info.GetInt32(KEY_X);
        z         = info.GetInt32(KEY_Z);
        generated = info.GetBoolean(KEY_GENERATED);
        SerializableMesh sMesh = (SerializableMesh)info.GetValue(KEY_MESH, typeof(SerializableMesh));

        if (sMesh != null)
        {
            mesh = sMesh.toMesh();
        }
        objs = (List <MapObject>)info.GetValue(KEY_OBJECTS, typeof(List <MapObject>));
        for (int a = 0; a < objs.Count; a++)
        {
            objs [a].chunk = this;
        }
    }