You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot put code here if it's not code. Therefore, I'll need to convert some of my simpler triggers into Jass, so that I can save it here.
Additionally, I need to ensure a style guide is followed for my code. I'll give a rough outline below:
// Includes at top of fileinclude"file.j"// Globals should be declared at the highest level trigger that uses them.globalsforcePLAYERS=CreateForce()
locationMAP_CENTER=Location(16384, 16384)
endglobals// Note the function declaration. Use 'void' instead of 'nothing'voidselectUnit() {
// Do not include the (implicit) keyword 'local'locationspawnpoint=MAP_CENTER// Do not include the (implicit) keyword 'call'CreateUnitAtLoc(GetEnumPlayer(), 'h000', spawnpoint, GetRandomReal(0, 360))
// This is cJass - remember to make use of { }if (GetLocalPlayer() ==GetEnumPlayer()) {
ClearSelection()
SelectUnit(bj_lastCreatedUnit, true)
}
}
// Function comments should always be included, even if just simple ones./** * Adds one to the number provided, then doubles it. * I could have done this by typing: "++subject*2" */intaddOneAndDouble(intsubject) {
subject++subject *= 2returnsubject
}
The text was updated successfully, but these errors were encountered:
Before closing this, ensure that all globals are appropriately declared (Ideally above the method that uses them), and general code base is tidy. There should never again have to be a refactor once this is done.
I cannot put code here if it's not code. Therefore, I'll need to convert some of my simpler triggers into Jass, so that I can save it here.
Additionally, I need to ensure a style guide is followed for my code. I'll give a rough outline below:
The text was updated successfully, but these errors were encountered: