Factory method pattern: Difference between revisions

Content deleted Content added
Function type hinting was unexplicably limited to -> None as a return type. Expanded this to include the make_room() functions, that now have the correct return type hint. Also added type hint to room parameter in Room's function connect().
Xtay2 (talk | contribs)
m Java: The return types can be further specified in overriding subclasses.
Line 209:
public class MagicMazeGame extends MazeGame {
@Override
protected RoomMagicRoom makeRoom() {
return new MagicRoom();
}
Line 216:
public class OrdinaryMazeGame extends MazeGame {
@Override
protected RoomOrdinaryRoom makeRoom() {
return new OrdinaryRoom();
}