Post Port Pseudocode Foundry - Milowan/WarChildPort GitHub Wiki

Foundry : public Menu

WeaponBlueprint[] blueprints PlayerInventory inventory

Foundry()

queue up foundry open/close with UI events

SetInventory(PlayerInventory inv)

set inventory to inv

WeaponBlueprint : public UserWidget

  • Weapon weapon
  • Coin coinCost
  • Minerals mineralCost
  • Plastics plasticCost

UnlockWeapon()

if inventory has enough of each resource unlock the weapon

MachinePistolBlueprint : public WeaponBlueprint

MachinePistolBlueprint()

set resource costs of weapon and set weapon to a MachinePistol

AdvancedRifleBlueprint : public WeaponBlueprint

AdvancedRifleBlueprint()

set resource costs of weapon and set weapon to an AdvancedRifle

WeaponManager

  • ObjectPool pool
  • Weapon* equippedWeapon
  • static Weapon* instance

GetInstance()

if it exists return the instance else set instance to a new instance and return it

Release()

delete instance and set it to NULL

GetEquippedWeapon()

return equippedWeapon

SetEquippedWeapon(Weapon* weapon)

set equippedWeapon to weapon

GetPool()

return pointer to the pool

#CraftBPButton : public UIButton

Activated()

unlock the weapon on the connected BP

⚠️ **GitHub.com Fallback** ⚠️