Bga globals from legacy framework

Game development with Board Game Arena Studio
Post Reply
User avatar
RavingWanderer
Posts: 83
Joined: 12 May 2020, 16:08

Bga globals from legacy framework

Post by RavingWanderer »

Is there a way to use bga globals (and perhaps more generally other features of the bga object) from a legacy X.game.php source? I'm not ready to reconstruct my game in the current framework model but accessing the bga object capabilities could serve as a useful gradual transition.
User avatar
thoun
Posts: 1620
Joined: 10 December 2020, 22:25

Re: Bga globals from legacy framework

Post by thoun »

You can access it the same way as for non-legacy Game.php
User avatar
RavingWanderer
Posts: 83
Joined: 12 May 2020, 16:08

Re: Bga globals from legacy framework

Post by RavingWanderer »

$this->bga is either not defined or is null, I get exceptions trying to access it. (Game is Hand and Foot.)
User avatar
thoun
Posts: 1620
Joined: 10 December 2020, 22:25

Re: Bga globals from legacy framework

Post by thoun »

I replaced the extends \Table in your main class by Bga\GameFramework\Table and I was able to access $this->bga. Don't hesitate to cleanup the warnings of the Dry-run build if you can :)
User avatar
RavingWanderer
Posts: 83
Joined: 12 May 2020, 16:08

Re: Bga globals from legacy framework

Post by RavingWanderer »

I was wondering if that was needed, but was concerned if there were knock-on effects to doing so. Thanks for looking at this.
Post Reply

Return to “Developers”