Page 1 of 1

BGA Studio built-in functions documentation?

Posted: 17 April 2020, 00:06
by cmgames
Is there any sort of documentation available on *all* the BGA built-in functions?

My immediate need is for an explanation of the DB functions like:
self::DbQuery
self::getObjectFromDB
self::getCollectionFromDb

Also would like to see if there is a way to capture (or display and stop) the results of a SQL query.

I have searched these forums and all the links on the BGA welcome screen and drilled down all the pull-down menus and cannot find the documentation (if it exists). The "BGA Studio Documentation" stickied at the top of this forum is just the same info as appears on the welcome screen - no joy there.

~cmgames

Re: BGA Studio built-in functions documentation?

Posted: 17 April 2020, 00:19
by Fritz
It's somewhat distributed throughout the BGA Studio Wiki. Start at this page: http://en.doc.boardgamearena.com/Studio

You can search for the relevant functions with the search function. The functions you are looking for are here: http://en.doc.boardgamearena.com/Main_g ... e.game.php

I agree though, that at least stubs with proper PHPdoc comments for ALL relevant BGA studio classes would be very much preferable. Then I could see the function documentation directly in PHPStorm or VSCode when hovering the function name...

Re: BGA Studio built-in functions documentation?

Posted: 07 June 2020, 08:34
by nickpeirson
I came here looking for this as well. Not having a good set of stubs to feed to an IDE is like developing with one hand tied behind your back :)

I did find that BGA Workbench has some very basic stubs.

Perhaps running phpDocumentor against the classes that make up the BGA Studio API would be a good start, as that would provide a relatively clean set of documentation for little effort.

I'd be happy to help with either of the above projects.

Re: BGA Studio built-in functions documentation?

Posted: 08 June 2020, 19:06
by nickpeirson
I've started writing out some stubs here and run it through PHPDocumentor to produce html docs.

At the moment I've just stubbed the Deck component from the docs. I'll update it as I use it in anger, as well as adding more stubs for other components.

Any help greatly appreciated, PRs welcome!

Re: BGA Studio built-in functions documentation?

Posted: 09 June 2020, 01:11
by Victoria_La
I added most stubs too a couple years ago in sharedcode project, listed on BGA_Code_Sharing page:
http://en.doc.boardgamearena.com/BGA_Code_Sharing

Maybe we should create wikis out of it because considering it been replicated so many times people cannot find these projects...