Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: CamDawg on January 06, 2019, 06:40:00 PM

Title: GAME_IS documentation
Post by: CamDawg on January 06, 2019, 06:40:00 PM
Is it documented anywhere what GAME_IS actually checks?

Every one in a (long) while I'll get some screwy bug report where a GAME_IS apparently flows down the wrong path of the logic check. I'm willing to bet it's typically an error in my code somewhere, but it would be nice to see this delineated somewhere.
Title: Re: GAME_IS documentation
Post by: Mike1072 on January 06, 2019, 09:44:20 PM
You can go right to the source code:

https://github.com/WeiDUorg/weidu/blob/b26ebf21541dc722485b4948b5b058b19c8a28c7/src/tppe.ml#L416-L501
Title: Re: GAME_IS documentation
Post by: The Imp on January 07, 2019, 06:56:50 AM
So technically, nope. :P
Title: Re: GAME_IS documentation
Post by: Wisp on January 07, 2019, 11:12:05 AM
What GAME_IS checks is a so-called implementation detail and may be subject to change, should a situation arise where some check would need to be altered in order for GAME_IS to function as documented. The contract (subject to documentation) is that GAME_IS says what game it is. How it arrives at that conclusion is not part of the contract.
Title: Re: GAME_IS documentation
Post by: The Imp on January 08, 2019, 06:09:38 PM
By the way, how did you Mike "search" the GitHub code for the specific code ? Was it that you knew this to be there, or ... asking cause it could help me build off from the weidu's own functionality, as it's sometimes easier to reduce than expand.
Title: Re: GAME_IS documentation
Post by: Mike1072 on January 08, 2019, 09:19:25 PM
I had seen it previously so I knew it existed.

I couldn't remember exactly where it was off-hand, so I searched for GAME_IS to track down what it was mapped to (PE_GameIs) and then searched for PE_GameIs and found the implementation in tppe.ml.

You can search a repo by entering text in the textbox in the top left.  It doesn't usually let you search within a repo if that repo is a fork, so you have to go to the main repo and search there.
Title: Re: GAME_IS documentation
Post by: The Imp on January 08, 2019, 10:24:17 PM
So you go into the main repo, push the "Find file" button on the middle top right, which open the "repo path" in the left corner that allows you to search for terms, and find files that contain it. And of course then one can use the browsers own search funtion to find the specific cases, in a long file.
Good, thanks.
Title: Re: GAME_IS documentation
Post by: Mike1072 on January 08, 2019, 11:14:30 PM
No, I enter my text in the textbox in the top left, like I said.

Maybe this (https://i.imgur.com/sq71RZJ.png) will help.
Title: Re: GAME_IS documentation
Post by: The Imp on January 09, 2019, 06:00:38 AM
Maybe this (https://i.imgur.com/sq71RZJ.png) will help.
Uuh, that requires one just to log into the github. Aah... so yes, it did. Thanks much man.