Ticket #4128: compinterfacecomment.2.diff
File compinterfacecomment.2.diff, 20.4 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/interfaces/AIProxy.js
1 1 Engine.RegisterInterface("AIProxy"); 2 2 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 */ 5 7 Engine.RegisterMessageType("AIMetadata"); -
binaries/data/mods/public/simulation/components/interfaces/Attack.js
1 1 Engine.RegisterInterface("Attack"); 2 2 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 to the target entity, each time the target is damaged. 6 */ 6 7 Engine.RegisterMessageType("Attacked"); -
binaries/data/mods/public/simulation/components/interfaces/AttackDetection.js
1 1 Engine.RegisterInterface("AttackDetection"); 2 2 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": { "target": number , "position": { "x": number, "z": number }, "time": number, "targetIsDomesticAnimal": boolean } } 5 * sent from AttackDetection component when a new attack is detected. 6 */ 5 7 Engine.RegisterMessageType("AttackDetected"); -
binaries/data/mods/public/simulation/components/interfaces/BattleDetection.js
1 1 Engine.RegisterInterface("BattleDetection"); 2 2 3 // Message of the form { "to": "STATE" }. 4 // sent whenever the battle state changes 3 /** 4 * Message of the form { "to": string } 5 * sent from BattleDetection component whenever the battle state changes. 6 */ 5 7 Engine.RegisterMessageType("BattleStateChanged"); -
binaries/data/mods/public/simulation/components/interfaces/Capturable.js
1 1 Engine.RegisterInterface("Capturable"); 2 2 3 // Message in the form of {"capturePoints": [gaia, p1, p2, ...]} 3 /** 4 * Message of the form { "capturePoints": array } 5 * where "capturePoints" value is an array indexed by players id, 6 * sent from Capturable component. 7 */ 4 8 Engine.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 * where "rate" value is always zero when not decaying, 13 * sent from Capturable component. 14 */ 7 15 Engine.RegisterMessageType("CaptureRegenStateChanged"); 8 16 -
binaries/data/mods/public/simulation/components/interfaces/CeasefireManager.js
1 1 Engine.RegisterInterface("CeasefireManager"); 2 2 3 /** 4 * Message sent from CeasefireManager component. 5 */ 3 6 Engine.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 */ 11 Engine.RegisterMessageType("CeasefireEnded"); -
binaries/data/mods/public/simulation/components/interfaces/EndGameManager.js
1 1 Engine.RegisterInterface("EndGameManager"); 2 3 /** 4 * Message of the form { "playerID": number } 5 * sent from EndGameManager component when the player is defeated. 6 */ 2 7 Engine.RegisterMessageType("PlayerDefeated"); 8 9 /** 10 * Message of the form { "playerID": number } 11 * sent from EndGameManager component when the player has won. 12 */ 3 13 Engine.RegisterMessageType("PlayerWon"); 14 15 /** 16 * Message of the form {} 17 * sent from EndGameManager component. 18 */ 4 19 Engine.RegisterMessageType("GameTypeChanged"); -
binaries/data/mods/public/simulation/components/interfaces/Foundation.js
1 1 Engine.RegisterInterface("Foundation"); 2 2 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 */ 7 8 Engine.RegisterMessageType("ConstructionFinished"); 8 9 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 */ 11 15 Engine.RegisterMessageType("FoundationProgressChanged"); 12 16 13 // Message of the form { "to", [builders] }, as the builders change 17 /** 18 * Message of the form { "to": array } 19 * where "to" value is an array of builders entity id, 20 * sent from Foundation component whenever the foundation builders changes. 21 */ 14 22 Engine.RegisterMessageType("FoundationBuildersChanged"); -
binaries/data/mods/public/simulation/components/interfaces/GarrisonHolder.js
1 1 Engine.RegisterInterface("GarrisonHolder"); 2 2 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": array, "removed": array } 5 * sent from the GarrisonHolder component to the current entity whenever the garrisoned units change. 6 */ 5 7 Engine.RegisterMessageType("GarrisonedUnitsChanged"); 6 8 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 */ 9 13 Engine.RegisterMessageType("UnitGarrisonedAfterAlert"); -
binaries/data/mods/public/simulation/components/interfaces/Guard.js
1 1 Engine.RegisterInterface("Guard"); 2 2 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 by Guard component whenever a guarded/escorted unit is attacked. 7 */ 5 8 Engine.RegisterMessageType("GuardedAttacked"); -
binaries/data/mods/public/simulation/components/interfaces/Health.js
1 1 Engine.RegisterInterface("Health"); 2 2 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 */ 5 7 Engine.RegisterMessageType("HealthChanged"); -
binaries/data/mods/public/simulation/components/interfaces/Messages.js
1 1 /** 2 * Broadcast message2 * Message of the form { entity: number, newentity: number } 3 3 * sent when one entity is changed to other: 4 4 * - from Foundation component when building construction is done 5 5 * - from Promotion component when unit is promoted 6 6 * - from Mirage component when a fogged entity is re-discovered 7 * Data: { entity: <integer>, newentity: <integer> }8 7 */ 9 8 Engine.RegisterMessageType("EntityRenamed"); 10 9 10 /** 11 * Message of the form { player: number, otherPlayer: number } 12 * sent from Player component when diplomacy changed for one player or between two players. 13 */ 11 14 Engine.RegisterMessageType("DiplomacyChanged"); 12 15 13 // Message of the form { "to": receiver, "from": sender, "amounts": amounts }. 14 // sent whenever a tribute is sent 16 /** 17 * Message of the form { "to": number, "from": number, "amounts": object } 18 * sent from Player component whenever a tribute is sent. 19 */ 15 20 Engine.RegisterMessageType("TributeExchanged"); 16 21 17 // Message sent by InitGame for component map-dependent initialization 22 /** 23 * Message of the form {} 24 * sent by InitGame for component map-dependent initialization. 25 */ 18 26 Engine.RegisterMessageType("InitGame"); -
binaries/data/mods/public/simulation/components/interfaces/Pack.js
1 1 Engine.RegisterInterface("Pack"); 2 2 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 by Pack component whenever packing progress is updated. 6 */ 5 7 Engine.RegisterMessageType("PackProgressUpdate"); 6 8 7 // Message of the form { "packed": true }, 8 // sent whenever packing finishes. 9 /** 10 * Message of the form { "packed": boolean } 11 * sent by Pack component whenever packing finishes. 12 */ 9 13 Engine.RegisterMessageType("PackFinished"); -
binaries/data/mods/public/simulation/components/interfaces/Player.js
1 1 /** 2 * Warn other components when a player changed civs 2 * Message of the form { "player": number, "from": string, "to": string } 3 * sent by Player component to warn other components when a player changed civs. 3 4 * This should only happen in Atlas 4 5 */ 5 6 Engine.RegisterMessageType("CivChanged"); -
binaries/data/mods/public/simulation/components/interfaces/ProductionQueue.js
1 1 Engine.RegisterInterface("ProductionQueue"); 2 2 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 {} (use GetQueue if you want the current details), 5 * sent from ProductionQueue component to the current entity whenever the training queue changes. 6 */ 5 7 Engine.RegisterMessageType("ProductionQueueChanged"); 6 8 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 */ 9 13 Engine.RegisterMessageType("TrainingStarted"); 10 14 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": array, "owner": number, "metadata": object } 17 * sent from ProductionQueue component to the current entity whenever a unit has been trained. 18 */ 13 19 Engine.RegisterMessageType("TrainingFinished"); -
binaries/data/mods/public/simulation/components/interfaces/ResourceDropsite.js
1 1 Engine.RegisterInterface("ResourceDropsite"); 2 2 3 // Message of the form { "shared": true }, 3 /** 4 * Message of the form { "shared": boolean } 5 * sent by ResourceDropsite component. 6 */ 4 7 Engine.RegisterMessageType("DropsiteSharingChanged"); -
binaries/data/mods/public/simulation/components/interfaces/ResourceGatherer.js
1 1 Engine.RegisterInterface("ResourceGatherer"); 2 2 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 */ 5 7 Engine.RegisterMessageType("ResourceCarryingChanged"); -
binaries/data/mods/public/simulation/components/interfaces/ResourceSupply.js
1 1 Engine.RegisterInterface("ResourceSupply"); 2 2 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 */ 5 7 Engine.RegisterMessageType("ResourceSupplyChanged"); 6 8 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 */ 9 13 Engine.RegisterMessageType("ResourceSupplyNumGatherersChanged"); -
binaries/data/mods/public/simulation/components/interfaces/SkirmishReplacer.js
1 1 Engine.RegisterInterface("SkirmishReplacer"); 2 3 /** 4 * Message of the form {} 5 * sent from InitGame. 6 */ 2 7 Engine.RegisterMessageType("SkirmishReplace"); -
binaries/data/mods/public/simulation/components/interfaces/TechnologyManager.js
1 1 Engine.RegisterInterface("TechnologyManager"); 2 2 3 /** 4 * Message of the form { "player": number, "tech": string } 5 * sent from TechnologyManager component whenever a technology research is finished. 6 */ 3 7 Engine.RegisterMessageType("ResearchFinished"); 4 -
binaries/data/mods/public/simulation/components/interfaces/TerritoryDecay.js
1 1 Engine.RegisterInterface("TerritoryDecay"); 2 2 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 */ 5 7 Engine.RegisterMessageType("TerritoryDecayChanged"); -
binaries/data/mods/public/simulation/components/interfaces/Trigger.js
1 1 Engine.RegisterInterface("Trigger"); 2 2 3 /** 4 * Message of the form {} 5 * sent from Player component. 6 */ 3 7 Engine.RegisterMessageType("DisabledTemplatesChanged"); 4 8 9 /** 10 * Message of the form {} 11 * sent from Player component. 12 */ 5 13 Engine.RegisterMessageType("DisabledTechnologiesChanged"); -
binaries/data/mods/public/simulation/components/interfaces/UnitAI.js
1 1 Engine.RegisterInterface("UnitAI"); 2 2 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 whenever the unit's idle status changes. 6 */ 5 7 Engine.RegisterMessageType("UnitIdleChanged"); 6 8 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 whenever the unit changes state. 13 */ 9 14 Engine.RegisterMessageType("UnitAIStateChanged"); 10 15 11 // Message of the form { "to": orderData }. 12 // sent whenever the unit changes state 16 /** 17 * Message of the form { "to": array } 18 * where "to" value is an array of data orders given by GetOrderData, 19 * sent whenever the unit order data changes. 20 */ 13 21 Engine.RegisterMessageType("UnitAIOrderDataChanged"); 14 22 15 // Message of the form { "entity": entity }, 16 // sent whenever a pickup is requested 23 /** 24 * Message of the form { "entity": number } 25 * sent whenever a pickup is requested. 26 */ 17 27 Engine.RegisterMessageType("PickupRequested"); 18 28 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 whenever a pickup is no more needed. 32 */ 21 33 Engine.RegisterMessageType("PickupCanceled");