Template:OOP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Added 'template documentation' template) |
||
(25 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly><u>'''OOP Syntax'''</u> <small>[[OOP Introduction|Help! I don't understand this!]]</small> | ||
{{#if: {{{1|}}} |: '''Note''': ''{{{1}}}''|}}{{#if: {{{2|}}} |: '''Method''': ''{{{2}}}(...)''|}}{{#if: {{{3|}}} |: '''Variable''': ''.{{{3}}}''|}}{{#if: {{{4|}}} |: '''Counterpart''': ''[[{{{4}}}]]''|}}</includeonly><noinclude>{{Template documentation|Template for OOP (object orientated programming)| | |||
<u>'''OOP Syntax'''</u> | {{OOP|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}} | ||
{{#if: {{{1|}}} |: '''Note''': ''{{{1}}}''|}} | <syntaxhighlight lang="lua">{{OOP|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}</syntaxhighlight> | ||
{{#if: {{{2|}}} |: ''' | |||
{{#if: {{{3|}}} |: '''Variable''': ''{{{3}}}''|}} | Hey guys, here are a few "rules" in using the OOP template: | ||
{{#if: {{{4|}}} |: ''' | * If it's a constructor, such as [[createPed]], use "[[Ped]]" not "createPed" or "Ped.create" | ||
{{OOP| | * If it's a static class function or a constructor, use a capital letter for the first character. (Player not player). | ||
* Likewise, if it's an object function such as "player:setName", use lowercase. | |||
* Use full stops (or if you're american, "periods.") for static functions and colons (:) for object functions. | |||
}} | |||
</noinclude> | </noinclude> |
Revision as of 19:52, 23 January 2017
Template Documentation
Template for OOP (object orientated programming)
Usage
OOP Syntax Help! I don't understand this!
- Note: Set the variable to nil to execute removePedFromVehicle
- Method: ped:warpIntoVehicle(...)
- Variable: .vehicle
- Counterpart: getPedOccupiedVehicle
{{OOP|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}
Hey guys, here are a few "rules" in using the OOP template:
- If it's a constructor, such as createPed, use "Ped" not "createPed" or "Ped.create"
- If it's a static class function or a constructor, use a capital letter for the first character. (Player not player).
- Likewise, if it's an object function such as "player:setName", use lowercase.
- Use full stops (or if you're american, "periods.") for static functions and colons (:) for object functions.