This wiki is archived and useful information is being migrated to the main bzflag.org website
Editing Template:Apicall/doc
Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to copy and paste your text into a text file and save it for later.
The administrator who locked it offered this explanation: Archived wiki
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
This template can be used for bzfs api call documentation pages. It contains fields for the parameters of the api call, it's return type (if any), a description for it, and some other api calls that can be referenced. The template supports up to 10 api call parameters, although support for more can be added by editing this template. | This template can be used for bzfs api call documentation pages. It contains fields for the parameters of the api call, it's return type (if any), a description for it, and some other api calls that can be referenced. The template supports up to 10 api call parameters, although support for more can be added by editing this template. | ||
− | |||
− | |||
To use the template, you must include at least a name parameter, and preferably a description. For example, a call that takes no arguments and returns nothing, and that doesn't have a desctiption, could be declared like this: | To use the template, you must include at least a name parameter, and preferably a description. For example, a call that takes no arguments and returns nothing, and that doesn't have a desctiption, could be declared like this: | ||
<pre>{{apicall | <pre>{{apicall | ||
− | | name = bz_testApiCall | + | | name = bz_testApiCall() |
− | + | ||
}}</pre> | }}</pre> | ||
Line 14: | Line 11: | ||
{{apicall | {{apicall | ||
− | | name = bz_testApiCall | + | | name = bz_testApiCall() |
− | + | ||
}} | }} | ||
If we wanted a description for our call, we could do something like this: | If we wanted a description for our call, we could do something like this: | ||
<pre>{{apicall | <pre>{{apicall | ||
− | | name = bz_testApiCall | + | | name = bz_testApiCall() |
| description = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented. | | description = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented. | ||
− | |||
}}</pre> | }}</pre> | ||
Line 29: | Line 24: | ||
{{apicall | {{apicall | ||
− | | name = bz_testApiCall | + | | name = bz_testApiCall() |
| description = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented. | | description = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented. | ||
− | |||
}} | }} | ||
Now let's say that our function takes some parameters. We can add those like this: | Now let's say that our function takes some parameters. We can add those like this: | ||
<pre>{{apicall | <pre>{{apicall | ||
− | | name = bz_testApiCall | + | | name = bz_testApiCall(int theFirstParameter, int theSecondParameter) |
| description = This function does nothing, except that it accepts two numbers as inputs. | | description = This function does nothing, except that it accepts two numbers as inputs. | ||
| param1 = theFirstParameter | | param1 = theFirstParameter | ||
− | |||
| param1desc = This number is the first number. It doesn't do anything. | | param1desc = This number is the first number. It doesn't do anything. | ||
| param2 = theSecondParameter | | param2 = theSecondParameter | ||
− | |||
| param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | | param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | ||
− | |||
}}</pre> | }}</pre> | ||
Line 51: | Line 42: | ||
{{apicall | {{apicall | ||
− | | name = bz_testApiCall | + | | name = bz_testApiCall(int theFirstParameter, int theSecondParameter) |
| description = This function does nothing, except that it accepts two numbers as inputs. | | description = This function does nothing, except that it accepts two numbers as inputs. | ||
| param1 = theFirstParameter | | param1 = theFirstParameter | ||
− | |||
| param1desc = This number is the first number. It doesn't do anything. | | param1desc = This number is the first number. It doesn't do anything. | ||
| param2 = theSecondParameter | | param2 = theSecondParameter | ||
− | |||
| param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | | param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | ||
− | |||
}} | }} | ||
We can also add documentation on the function's return value. This can be done like this: | We can also add documentation on the function's return value. This can be done like this: | ||
<pre>{{apicall | <pre>{{apicall | ||
− | | name = bz_testApiCall | + | | name = int bz_testApiCall(int theFirstParameter, int theSecondParameter) |
| description = This function does nothing, except that it accepts two numbers as inputs. | | description = This function does nothing, except that it accepts two numbers as inputs. | ||
| param1 = theFirstParameter | | param1 = theFirstParameter | ||
− | |||
| param1desc = This number is the first number. It doesn't do anything. | | param1desc = This number is the first number. It doesn't do anything. | ||
| param2 = theSecondParameter | | param2 = theSecondParameter | ||
− | |||
| param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | | param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | ||
− | + | | returns = A number that means absolutely nothing. It might be 0, or it might be 1, or it might be something else. | |
− | | returns = A | + | |
}}</pre> | }}</pre> | ||
Line 80: | Line 65: | ||
{{apicall | {{apicall | ||
− | | name = bz_testApiCall | + | | name = int bz_testApiCall(int theFirstParameter, int theSecondParameter) |
| description = This function does nothing, except that it accepts two numbers as inputs. | | description = This function does nothing, except that it accepts two numbers as inputs. | ||
| param1 = theFirstParameter | | param1 = theFirstParameter | ||
− | |||
| param1desc = This number is the first number. It doesn't do anything. | | param1desc = This number is the first number. It doesn't do anything. | ||
| param2 = theSecondParameter | | param2 = theSecondParameter | ||
− | |||
| param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | | param2desc = This is the second of the two numbers. Like the first number, this one does absolutely nothing. | ||
− | + | | returns = A number that means absolutely nothing. It might be 0, or it might be 1, or it might be something else. | |
− | | returns = A | + | |
}} | }} |