Post Port Pseudocode Foundry - Milowan/WarChildPort GitHub Wiki
WeaponBlueprint[] blueprints PlayerInventory inventory
queue up foundry open/close with UI events
set inventory to inv
- Weapon weapon
- Coin coinCost
- Minerals mineralCost
- Plastics plasticCost
if inventory has enough of each resource unlock the weapon
set resource costs of weapon and set weapon to a MachinePistol
set resource costs of weapon and set weapon to an AdvancedRifle
- ObjectPool pool
- Weapon* equippedWeapon
- static Weapon* instance
if it exists return the instance else set instance to a new instance and return it
delete instance and set it to NULL
return equippedWeapon
set equippedWeapon to weapon
return pointer to the pool
#CraftBPButton : public UIButton
unlock the weapon on the connected BP