Ticket #4128: compinterfacecomment.6.diff

File compinterfacecomment.6.diff, 20.8 KB (added by fatherbushido, 8 years ago)
  • binaries/data/mods/public/simulation/components/interfaces/AIProxy.js

     
    11Engine.RegisterInterface("AIProxy");
    22
    3 // Message of the form { "id": XXXX, "medatada", "owner": whatever }.
    4 // created to register metadata for buildings.
     3/**
     4 * Message of the form { "id": number, "metadata": object, "owner": number }
     5 * sent from Commands to register metadata for buildings.
     6 */
    57Engine.RegisterMessageType("AIMetadata");
  • binaries/data/mods/public/simulation/components/interfaces/Attack.js

     
    11Engine.RegisterInterface("Attack");
    22
    3 // Message sent from Attack to the target entity, each
    4 // time the target is damaged.
    5 // Data: { attacker: 123, target: 234, type: "Melee", damage: 123 }
     3/**
     4 * Message of the form { "attacker": number, "target": number, "type": string, "damage": number }
     5 * sent from Attack component and by Damage helper to the target entity, each time the target is attacked or damaged.
     6 */
    67Engine.RegisterMessageType("Attacked");
  • binaries/data/mods/public/simulation/components/interfaces/AttackDetection.js

     
    11Engine.RegisterInterface("AttackDetection");
    22
    3 // Message of the form { "player": 1, "event": { "target": 123 , "position": { "x": 123, "z": 456 }, "time": 1, }.
    4 // sent when a new attack is detected.
     3/**
     4 * Message of the form { "player": number, "event": object }
     5 * where "event" value is an object of the form
     6 * { "target": number , "position": { "x": number, "z": number }, "time": number, "targetIsDomesticAnimal": boolean }
     7 * sent from AttackDetection component when a new attack is detected.
     8 */
    59Engine.RegisterMessageType("AttackDetected");
  • binaries/data/mods/public/simulation/components/interfaces/BattleDetection.js

     
    11Engine.RegisterInterface("BattleDetection");
    22
    3 // Message of the form { "to": "STATE" }.
    4 // sent whenever the battle state changes
     3/**
     4 * Message of the form { "player": number, "to": string }
     5 * sent from BattleDetection component whenever the battle state changes.
     6 */
    57Engine.RegisterMessageType("BattleStateChanged");
  • binaries/data/mods/public/simulation/components/interfaces/Capturable.js

     
    11Engine.RegisterInterface("Capturable");
    22
    3 // Message in the form of {"capturePoints": [gaia, p1, p2, ...]}
     3/**
     4 * Message of the form { "capturePoints": number[] }
     5 * where "capturePoints" value is an array indexed by players id,
     6 * sent from Capturable component.
     7 */
    48Engine.RegisterMessageType("CapturePointsChanged");
    5 // Message in the form of {"regenerating": Boolean, "rate": Number}
    6 // Where rate is always zero when not decaying
     9
     10/**
     11 * Message in the form of { "regenerating": boolean, "rate": number, "territoryDecay": number }
     12 * or in the form { "ticking": boolean, "rate": number, "territoryDecay": number }
     13 * where "rate" value is always zero when not decaying,
     14 * sent from Capturable component.
     15 */
    716Engine.RegisterMessageType("CaptureRegenStateChanged");
    817
  • binaries/data/mods/public/simulation/components/interfaces/CeasefireManager.js

     
    11Engine.RegisterInterface("CeasefireManager");
    22
     3/**
     4 * Message sent from CeasefireManager component.
     5 */
    36Engine.RegisterMessageType("CeasefireStarted");
    4 Engine.RegisterMessageType("CeasefireEnded");
    5  Pas de fin de ligne à la fin du fichier
     7
     8/**
     9 * Message sent from CeasefireManager component.
     10 */
     11Engine.RegisterMessageType("CeasefireEnded");
  • binaries/data/mods/public/simulation/components/interfaces/EndGameManager.js

     
    11Engine.RegisterInterface("EndGameManager");
     2
     3/**
     4 * Message of the form { "playerID": number }
     5 * sent from Player component when the player is defeated.
     6 */
    27Engine.RegisterMessageType("PlayerDefeated");
     8
     9/**
     10 * Message of the form { "playerID": number }
     11 * sent from Player component when the player has won.
     12 */
    313Engine.RegisterMessageType("PlayerWon");
     14
     15/**
     16 * Message of the form {}
     17 * sent from EndGameManager component.
     18 */
    419Engine.RegisterMessageType("GameTypeChanged");
  • binaries/data/mods/public/simulation/components/interfaces/Foundation.js

     
    11Engine.RegisterInterface("Foundation");
    22
    3 // Message sent from Foundation to its own entity when construction
    4 // has been completed.
    5 // Units can watch for this and change task once it's complete.
    6 // Data: { entity: 123, newentity: 234 }
     3/**
     4 * Message of the form { "entity": number, "newentity": number }
     5 * sent from Foundation and Repairable components to its own entity when construction has been completed.
     6 * Units can watch for this and change task once it's complete.
     7 */
    78Engine.RegisterMessageType("ConstructionFinished");
    89
    9 // Message of the form { "to", 59 }, as the percentage complete
    10 // sent whenever the foundations progress changes.
     10/**
     11 * Message of the form { "to": number }
     12 * as the percentage complete,
     13 * sent from Foundation component whenever the foundations progress changes.
     14 */
    1115Engine.RegisterMessageType("FoundationProgressChanged");
    1216
    13 // Message of the form { "to", [builders] }, as the builders change
     17/**
     18 * Message of the form { "to": number[] }
     19 * where "to" value is an array of builders entity id,
     20 * sent from Foundation component whenever the foundation builders changes.
     21 */
    1422Engine.RegisterMessageType("FoundationBuildersChanged");
  • binaries/data/mods/public/simulation/components/interfaces/GarrisonHolder.js

     
    11Engine.RegisterInterface("GarrisonHolder");
    22
    3 // Message of the form { "added":[], "removed":[] } (and use GetEntities if you want the current details),
    4 // sent to the current entity whenever the garrisoned units change.
     3/**
     4 * Message of the form { "added": number[], "removed": number[] }
     5 * sent from the GarrisonHolder component to the current entity whenever the garrisoned units change.
     6 */
    57Engine.RegisterMessageType("GarrisonedUnitsChanged");
    68
    7 // Message of the form { "holder": this.entity, "unit" : unit } sent to the AlertRaiser
    8 // which ordered the unit "unit" to garrison.
     9/**
     10 * Message of the form { "holder": number, "unit" : number }
     11 * sent to the AlertRaiser which ordered the unit "unit" to garrison.
     12 */
    913Engine.RegisterMessageType("UnitGarrisonedAfterAlert");
  • binaries/data/mods/public/simulation/components/interfaces/Guard.js

     
    11Engine.RegisterInterface("Guard");
    22
    3 // Message of the form { "guarded": entity, "data": msg },
    4 // sent whenever a guarded/escorted unit is attacked
     3/**
     4 * Message of the form { "guarded": number, "data": object }
     5 * where "data" value is a valid MT_Attacked message,
     6 * sent from Guard component whenever a guarded/escorted unit is attacked.
     7 */
    58Engine.RegisterMessageType("GuardedAttacked");
  • binaries/data/mods/public/simulation/components/interfaces/Health.js

     
    11Engine.RegisterInterface("Health");
    22
    3 // Message of the form { "from": 100, "to", 90 },
    4 // sent whenever health changes.
     3/**
     4 * Message of the form { "from": number, "to": number }
     5 * sent from Health component whenever health changes.
     6 */
    57Engine.RegisterMessageType("HealthChanged");
  • binaries/data/mods/public/simulation/components/interfaces/Messages.js

     
    11/**
    2  * Broadcast message
     2 * Message of the form { entity: number, newentity: number }
    33 * sent when one entity is changed to other:
    4  * - from Foundation component when building construction is done
     4 * - from Foundation component when building construction
     5 * - from Formation component
     6 * - from Health component
    57 * - from Promotion component when unit is promoted
    68 * - from Mirage component when a fogged entity is re-discovered
    7  * Data: { entity: <integer>, newentity: <integer> }
     9 * - from SkirmishReplacer component
     10 * - from Transform
    811 */
    912Engine.RegisterMessageType("EntityRenamed");
    1013
     14/**
     15 * Message of the form { "player": number, "otherPlayer": number }
     16 * sent from Player component when diplomacy changed for one player or between two players.
     17 */
    1118Engine.RegisterMessageType("DiplomacyChanged");
    1219
    13 // Message of the form { "to": receiver, "from": sender, "amounts": amounts }.
    14 // sent whenever a tribute is sent
     20/**
     21 * Message of the form { "to": number, "from": number, "amounts": object }
     22 * sent from Player component whenever a tribute is sent.
     23 */
    1524Engine.RegisterMessageType("TributeExchanged");
    1625
    17 // Message sent by InitGame for component map-dependent initialization
     26/**
     27 * Message of the form {}
     28 * sent from InitGame for component map-dependent initialization.
     29 */
    1830Engine.RegisterMessageType("InitGame");
  • binaries/data/mods/public/simulation/components/interfaces/Pack.js

     
    11Engine.RegisterInterface("Pack");
    22
    3 // Message of the form { "progress": 0.5 },
    4 // sent whenever packing progress is updated.
     3/**
     4 * Message of the form { "progress": number }
     5 * sent from Pack component whenever packing progress is updated.
     6 */
    57Engine.RegisterMessageType("PackProgressUpdate");
    68
    7 // Message of the form { "packed": true },
    8 // sent whenever packing finishes.
     9/**
     10 * Message of the form { "packed": boolean }
     11 * sent from Pack component whenever packing finishes.
     12 */
    913Engine.RegisterMessageType("PackFinished");
  • binaries/data/mods/public/simulation/components/interfaces/Player.js

     
    11/**
    2  * Warn other components when a player changed civs
     2 * Message of the form { "player": number, "from": string, "to": string }
     3 * sent from Player component to warn other components when a player changed civs.
    34 * This should only happen in Atlas
    45 */
    56Engine.RegisterMessageType("CivChanged");
  • binaries/data/mods/public/simulation/components/interfaces/ProductionQueue.js

     
    11Engine.RegisterInterface("ProductionQueue");
    22
    3 // Message of the form { } (use GetQueue if you want the current details),
    4 // sent to the current entity whenever the training queue changes.
     3/**
     4 * Message of the form {}
     5 * sent from ProductionQueue component to the current entity whenever the training queue changes.
     6 */
    57Engine.RegisterMessageType("ProductionQueueChanged");
    68
    7 // Message of the form { entity: id }
    8 // sent to the current entity whenever a unit is about to be trained.
     9/**
     10 * Message of the form { "entity": number }
     11 * sent from ProductionQueue component to the current entity whenever a unit is about to be trained.
     12 */
    913Engine.RegisterMessageType("TrainingStarted");
    1014
    11 // Message of the form { entities: [id, ...], metadata: ... }
    12 // sent to the current entity whenever a unit has been trained.
     15/**
     16 * Message of the form { "entities": number[], "owner": number, "metadata": object }
     17 * sent from ProductionQueue component to the current entity whenever a unit has been trained.
     18 */
    1319Engine.RegisterMessageType("TrainingFinished");
  • binaries/data/mods/public/simulation/components/interfaces/ResourceDropsite.js

     
    11Engine.RegisterInterface("ResourceDropsite");
    22
    3 // Message of the form { "shared": true },
     3/**
     4 * Message of the form { "shared": boolean }
     5 * sent from ResourceDropsite component.
     6 */
    47Engine.RegisterMessageType("DropsiteSharingChanged");
  • binaries/data/mods/public/simulation/components/interfaces/ResourceGatherer.js

     
    11Engine.RegisterInterface("ResourceGatherer");
    22
    3 // Message of the form { "to", [ {"type":"wood", "amount":7, "max":10} ] },
    4 // sent whenever carrying amount changes.
     3/**
     4 * Message of the form { "to": [{ "type": string, "amount": number, "max":number }] }
     5 * sent from ResourceGatherer component whenever carrying amount changes.
     6 */
    57Engine.RegisterMessageType("ResourceCarryingChanged");
  • binaries/data/mods/public/simulation/components/interfaces/ResourceSupply.js

     
    11Engine.RegisterInterface("ResourceSupply");
    22
    3 // Message of the form { "from": 100, "to", 90 },
    4 // sent whenever supply level changes.
     3/**
     4 * Message of the form { "from": number, "to": number }
     5 * sent from ResourceSupply component whenever supply level changes.
     6 */
    57Engine.RegisterMessageType("ResourceSupplyChanged");
    68
    7 // Message of the form { "to": 10 },
    8 // sent whenever the number of gatherer changes
     9/**
     10 * Message of the form { "to": number }
     11 * sent from ResourceSupply component whenever the number of gatherer changes.
     12 */
    913Engine.RegisterMessageType("ResourceSupplyNumGatherersChanged");
  • binaries/data/mods/public/simulation/components/interfaces/SkirmishReplacer.js

     
    11Engine.RegisterInterface("SkirmishReplacer");
     2
     3/**
     4 * Message of the form {}
     5 * sent from InitGame.
     6 */
    27Engine.RegisterMessageType("SkirmishReplace");
  • binaries/data/mods/public/simulation/components/interfaces/TechnologyManager.js

     
    11Engine.RegisterInterface("TechnologyManager");
    22
     3/**
     4 * Message of the form { "player": number, "tech": string }
     5 * sent from TechnologyManager component whenever a technology research is finished.
     6 */
    37Engine.RegisterMessageType("ResearchFinished");
    4 
  • binaries/data/mods/public/simulation/components/interfaces/TerritoryDecay.js

     
    11Engine.RegisterInterface("TerritoryDecay");
    22
    3 // Message of the form { "entity": this.entity, "to": decaying }.
    4 // sent whenever the decay state changes
     3/**
     4 * Message of the form { "entity": number, "to": boolean, "rate": number }
     5 * sent from TerritoryDecay component whenever the decay state changes.
     6 */
    57Engine.RegisterMessageType("TerritoryDecayChanged");
  • binaries/data/mods/public/simulation/components/interfaces/Trigger.js

     
    11Engine.RegisterInterface("Trigger");
    22
     3/**
     4 * Message of the form {}
     5 * sent from Player component.
     6 */
    37Engine.RegisterMessageType("DisabledTemplatesChanged");
    48
     9/**
     10 * Message of the form {}
     11 * sent from Player component.
     12 */
    513Engine.RegisterMessageType("DisabledTechnologiesChanged");
  • binaries/data/mods/public/simulation/components/interfaces/UnitAI.js

     
    11Engine.RegisterInterface("UnitAI");
    22
    3 // Message of the form { "idle": true },
    4 // sent whenever the unit's idle status changes.
     3/**
     4 * Message of the form { "idle": boolean }
     5 * sent from UnitAI whenever the unit's idle status changes.
     6 */
    57Engine.RegisterMessageType("UnitIdleChanged");
    68
    7 // Message of the form { "to": "STATE.NAME" }.
    8 // sent whenever the unit changes state
     9/**
     10 * Message of the form { "to": string }
     11 * where "to" value is a UnitAI state.
     12 * sent from UnitAI whenever the unit changes state.
     13 */
    914Engine.RegisterMessageType("UnitAIStateChanged");
    1015
    11 // Message of the form { "to": orderData }.
    12 // sent whenever the unit changes state
     16/**
     17 * Message of the form { "to": number[] }
     18 * where "to" value is an array of data orders given by GetOrderData,
     19 * sent from UnitAI whenever the unit order data changes.
     20 */
    1321Engine.RegisterMessageType("UnitAIOrderDataChanged");
    1422
    15 // Message of the form { "entity": entity },
    16 // sent whenever a pickup is requested
     23/**
     24 * Message of the form { "entity": number }
     25 * sent from UnitAI whenever a pickup is requested.
     26 */
    1727Engine.RegisterMessageType("PickupRequested");
    1828
    19 // Message of the form { "entity": entity },
    20 // sent whenever a pickup is no more needed
     29/**
     30 * Message of the form { "entity": number }
     31 * sent from UnitAI whenever a pickup is no more needed.
     32 */
    2133Engine.RegisterMessageType("PickupCanceled");