Template:OOP: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (add OOP "rules")
(Rename "Pair" to "Counterpart". Tweak guidelines.)
Line 1: Line 1:
<includeonly><u>'''OOP Syntax'''</u>
<includeonly><u>'''OOP Syntax'''</u>
{{#if: {{{1|}}} |: '''Note''': ''{{{1}}}''|}}{{#if: {{{2|}}} |: '''Method''': ''{{{2}}}(...)''|}}{{#if: {{{3|}}} |: '''Variable''': ''.{{{3}}}''|}}{{#if: {{{4|}}} |: '''Pair''': ''[[{{{4}}}]]''|}}</includeonly><noinclude>
{{#if: {{{1|}}} |: '''Note''': ''{{{1}}}''|}}{{#if: {{{2|}}} |: '''Method''': ''{{{2}}}(...)''|}}{{#if: {{{3|}}} |: '''Variable''': ''.{{{3}}}''|}}{{#if: {{{4|}}} |: '''Counterpart''': ''[[{{{4}}}]]''|}}</includeonly><noinclude>
{{OOP|This function has been dropped in favour of [[setPlayerHudComponentVisible]] |[[player]].getRandom|random|isPlayerHudComponentVisible}}
{{OOP|This function has been dropped in favour of [[setPlayerHudComponentVisible]] |[[player]].getRandom|random|isPlayerHudComponentVisible}}


Hey guys, here are a few "rules" in using the OOP template:
Hey guys, here are a few "rules" in using the OOP template:
* If it's a constructor, such as [[createPed]], in the function use "[[Ped]]" not "createPed" or "Ped.create"
* 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).
* 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.
* 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.
* Use full stops (or if you're american, "periods.") for static functions and colons (:) for object functions.
 
 
</noinclude>
</noinclude>

Revision as of 19:21, 29 December 2015

OOP Syntax

Note: This function has been dropped in favour of setPlayerHudComponentVisible
Method: player.getRandom(...)
Variable: .random
Counterpart: isPlayerHudComponentVisible

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.