Package de.tum.cit.fop.maze.game_saves
Interface Saveable<T extends Memento>
- Type Parameters:
T- The type of memento used for saving state
- All Known Implementing Classes:
Bouncer,Exit,FreezeTrap,GarlicTrap,Heart,Junkie,Key,Player,Tourist
public interface Saveable<T extends Memento>
Interface for objects that can be saved and loaded using the Memento pattern.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a memento capturing the current state of this object.voidloadFromMemento(T memento) Restores the object's state from a memento.
-
Method Details
-
getMemento
T getMemento()Creates a memento capturing the current state of this object.- Returns:
- A memento containing the object's state
-
loadFromMemento
Restores the object's state from a memento.- Parameters:
memento- The memento containing the state to restore
-