Skip to content

This is a project aim to implement Open-closed Principle and Design Patterns

Notifications You must be signed in to change notification settings

wailim0506/ITP4507_Assignment

Repository files navigation

ITP4507 Assignemnt (Semester 1, 2024-2025)

This project aim to apply Open-closed principle and Design patterns

Task Specification

Snow Storm Company develops an RPG game "Fantastic World (FW)" on the PC. The major characters in this game are known as HERO and they have various kinds of characteristic. For example, Warrior focus on defence and Warlock target on magic damage. Each player in this game can play more than one hero. Currently, this game only has Warrior and Warlock. In the coming future, this game will be extended to support more kinds of hero such as healer. The following is the simplified class diagram of existing data maintained by FW.

classDiagram

As a system analyst of the Company, you are required to design and develop FW. You can get the source codes of above classes from Moodle. FW should provide the following functions:

  1. Create a Player.
  2. Add a hero (Warrior or Warlock) to the current player.
  3. Remove a hero from the current player.
  4. Select a player by using a player ID.
  5. Call a hero's skill by a hero ID.
  6. Show the detail information of current player.
  7. Change the player's name of the current player.
  8. Show all players.
  9. Set current player.
  10. Undo last command.
  11. Redo the last undone command.
  12. Show undo/redo list.
  13. Exit System.

Your system design should conform to the Open Closed Principle so that your design should easily be extended to support new heroes (for examples, healers, rangers etc..).

You MUST apply the following design patterns for your new system:

  • Command pattern to provide the “create player”, “set current player”, “add hero”, “call hero skill”, “delete hero”, “show current player”, “display all players”, “change player’s name”. “undo”, “redo” and “show undo/redo list” functions
  • Factory pattern or Abstract Factory Pattern to create different kinds of Command objects and different kinds of Player/Hero objects (e.g., Warrior object, Warlock object, Player object, etc.)
  • Memento pattern to provide “Undo” and “Redo” functions on the “call hero skill” and “change player’s name” functions.

About

This is a project aim to implement Open-closed Principle and Design Patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published