Wow I am running behind on these weeks in review! I currently have the previous three weeks drafted, let's see if I get them published before this one goes live? (You're in the future when I write this, did I do it?)
This week I mostly worked on my Space Mines project; after last months Rabbit Hole of Nuxt3 and reviving all my original attempts at getting this project off the ground I have ended up going back to what I know: #PHP and #Laravel.
I'll eventually get #LaravelJetstream involved in this project but for now I am working on getting all the core game mechanics complete and a working API. One piece of functionality I am quite proud of is having a
Building model that is able to become one of its siblings based upon its records
kind enum value. This is done via overloading Eloquents
newInstance methods with ones that check the building type and construct the new instance based upon their set class.
This nifty trick allows me to use the base
Building class for getting all buildings in a player's outpost, while the resulting collection will be a mix of all the inheriting building subclasses. I'm then sprinkling those classes with interfaces for
HasCrew and so on which allow differentiation of functionality between the various buildings.
I'll be writing about this in more detail within Space Mines, 2023 May Devlog.
Joke of the week
Notable Articles Read
- Rajiv Pant: Introducing Rbot: A Personalized AI Assistant, Written by Rbot
- Benek Lisefski: The Big Lie of “Good, Fast, Cheap”
- Jim Hall: Get started programming with DOS conio