Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoAI patch for revision 12187, makes most methods static #1785

Closed
DorpsGek opened this issue Feb 19, 2008 · 3 comments
Closed

NoAI patch for revision 12187, makes most methods static #1785

DorpsGek opened this issue Feb 19, 2008 · 3 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Morloth opened the ticket and wrote:

These patches make most methods found in the NoAI API static as they should be. There is no reason why the member functions should be non-static. It makes calling these functions more easy as you can now call:

AICargo.GetCargoLabel(id);

Instead of:
local cargoAI = AICargo();
cargoAI.GetCargoLabel(id);

I've made a different patch file for every class that needs to be modified in the NoAI API. Some might also include changes to the cpp file, as some would contain calls like: 'this->DoCommand(...)'; These are now replaced by 'DoCommand(...);' which does the same, only removes the dependency of an actual class instance.

- Bram

Attachments

Reported version: 0.5.3
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/1785
@DorpsGek
Copy link
Member Author

glx wrote:

We usually add /* static */ in .cpp for static functions. It helps to understand why there are no "this->".


This comment was imported from FlySpray: https://bugs.openttd.org/task/1785#comment3514

@DorpsGek
Copy link
Member Author

@DorpsGek
Copy link
Member Author

glx closed the ticket.

Reason for closing: Implemented

In r12216.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1785

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant