예제 #1
0
        public override IItemProperties Copy(double deltaX, double deltaY)
        {
            MapCharacter result = Clone(this);

            result.Move(deltaX, deltaY);
            return(result);
        }
예제 #2
0
        public static IItemProperties From(SerializedItem stamp)
        {
            MapCharacter mapCharacter = new MapCharacter();

            stamp.AssignPropertiesTo(mapCharacter);
            return(mapCharacter);
        }
예제 #3
0
        static MapCharacter Clone(MapCharacter character)
        {
            MapCharacter result = new MapCharacter(character.FileName, character.X, character.Y);

            result.GetPropertiesFrom(character, false);
            return(result);
        }
예제 #4
0
        public static IItemProperties CreateItemFrom(SerializedItem stamp)
        {
            // Coding Gorilla's suggestion has been implemented here!!!
            // ![](5BB3346892E7D77EE7412ACA3E59628A.png;;36,0,203,187)
            // TODO: Also be able to reconstruct Characters and CharacterGroups
            if (stamp.TypeName == "StampGroup")
            {
                return(StampGroup.From(stamp));
            }

            if (stamp.TypeName == "MapCharacterGroup")
            {
                return(MapCharacterGroup.From(stamp));
            }

            if (stamp.TypeName == "MapCharacter")
            {
                return(MapCharacter.From(stamp));
            }
            return(Stamp.From(stamp));
        }