Example-Code / CardArchitecture / README
README
Raw
This folder holds scripts that show the architecture I created for developing out different types of cards
in the most recent card game I worked on. Below you'll find several points about these scripts.

* At a high level, we like this architecture because it provides developers
an organized, frameworked way of adding behaviors to and managing cards while 
hiding code we don't need to see in each card type.

* At a lower level, I make use of inheritance here to store all common behavior and data in one place.
  I also utilize partial architecture here by encouraging major systems to go into a partial class.
  I give the example of input handling going into a corresponding partial class.
  It's nice because different card types may have different input handling and different logic to handle input events.


* To get a new card at runtime, we simply grab the type we want out of the pool, Setup() it, and then Activate() it.
  When we're done using the card, we simply Deactivate() it.

* You can read more about my custom ObjectPooler in the Object Pooler folder, 
  but my favorite two points about using it on cards here are eliminating all Instantiate() and GetComponent() calls at runtime.

* You'll notice I prefer to structure scripts in 3 sections, Variables, Callbacks, and Methods.
  This provides organization and if developers agree to use this styling, 
  it makes working in someone else's code easier.