Template:OOP ZH-CN: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "<includeonly><u>'''OOP Syntax'''</u> <small>Help! I don't understand this!</small> {{#if: {{{1|}}} |: '''Note''': ''{{{1}}}''|}}{{#if: {{{2|}}} |: '''Meth...")
 
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><u>'''OOP Syntax'''</u> <small>[[OOP Introduction|Help! I don't understand this!]]</small>
<includeonly><u>'''OOP 语法'''</u> <small>[[ZH-CN/OOP介绍|什么是OOP?]]</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)|
{{#if: {{{1|}}} |: '''提示''': ''{{{1}}}''|}}{{#if: {{{2|}}} |: '''方法''': ''{{{2}}}(...)''|}}{{#if: {{{3|}}} |: '''变量''': ''.{{{3}}}''|}}{{#if: {{{4|}}} |: '''对称函数''': ''[[{{{4}}}]]''|}}</includeonly><noinclude>{{Template documentation_ZH-CN|OOP模板(Object Oriented Programming)|
{{OOP|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}
{{OOP_ZH-CN|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}
<syntaxhighlight lang="lua">{{OOP|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}</syntaxhighlight>
<syntaxhighlight lang="lua">{{OOP_ZH-CN|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}</syntaxhighlight>


Hey guys, here are a few "rules" in using the OOP template:
Hey guys, here are a few "rules" in using the OOP template:

Latest revision as of 14:36, 3 February 2021

Applications-office.png文档模板

OOP模板(Object Oriented Programming)

用法

OOP 语法 什么是OOP?

提示: Set the variable to nil to execute removePedFromVehicle
方法: ped:warpIntoVehicle(...)
变量: .vehicle
对称函数: getPedOccupiedVehicle
{{OOP_ZH-CN|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.