iamlamb1988 / Arcade

The purpose of this project is to build extensible library of arcade games.
0 stars 0 forks source link

BlackJack2D implementation. #5

Closed iamlamb1988 closed 2 years ago

iamlamb1988 commented 2 years ago

Must develop a 2D interface with most/all BlackJack Components. This issue will ONLY focus on the Card and Shoe components only.

Main Issue: IF I extend a class BlackJackCard2D extends BlackJackCard (similarly with BlackJackShoe) TEHN we have a tightly coupled DIP violation and will be very difficult to make variations.

Most Likely, BlackJackCard will need to be an interface and the class should be some hardcoded library instance that implements the same interface

The location of these 2D items MUST be in the app package because they will depend on the "arcade" and "animation" library.

iamlamb1988 commented 2 years ago

Partial Solution: For each game object (BlackJack or any other game) WILL have an "instances" package/folder. class objects will implement the interfaces at the parent level. REMINDER: I am making Card the ONLY game class that intentionally violates DIP principle because it will never change.

Duplicate code may exist. If there is a Graphicless implementation of a Shoe and a 2D implementation in the app folder. Duplicate code will exist between the two implementations.

iamlamb1988 commented 2 years ago

BlackJackCard2D, BlackJackShoe2D should be setup EXACTLY the same way as the "arcade" packages. BlackJackCard2D, BlackJackShoe2D must be interfaces. A package called "instances" should contain class implementations. This will allow multiple hardened2D implementations. Should be easier because this will not be a graphically intense program.

iamlamb1988 commented 2 years ago

Definitely needs some clean up but works successfully. Planning on doing thorough cleanup when Test Cases are developed in order to simplify cleanup.