Beispiel #1
0
        public Rectangle DeserializeObject(Serializer serializer, int objectID)
        {
            ObjectDataRelay objectData = serializer.GetObjectData(objectID);

            X      = objectData.Get <int>(nameof(X));
            Y      = objectData.Get <int>(nameof(Y));
            Width  = objectData.Get <int>(nameof(Width));
            Height = objectData.Get <int>(nameof(Height));

            return(this);
        }
Beispiel #2
0
        public BackgroundImage DeserializeObject(Serializer serializer, int objectID)
        {
            ObjectDataRelay objectData = serializer.GetObjectData(objectID);

            int imageIndex = objectData.Get <int>(nameof(Image));

            Image = serializer.Deserialize <Image>(imageIndex);

            return(this);
        }
Beispiel #3
0
        public BackCover DeserializeObject(Serializer serializer, int objectID)
        {
            ObjectDataRelay objectData = serializer.GetObjectData(objectID);

            string backgroundType  = objectData.Get <string>(nameof(Background));
            int    backgroundIndex = objectData.Get <int>(nameof(Background));

            switch (backgroundType)
            {
            case "BackgroundColor":
                Background = serializer.Deserialize <BackgroundColor>(backgroundIndex);
                break;

            case "BackgroundImage":
                Background = serializer.Deserialize <BackgroundImage>(backgroundIndex);
                break;
            }

            return(this);
        }