aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/particles/plasmapatrol/content/Hardpoint.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/particles/plasmapatrol/content/Hardpoint.qml')
-rw-r--r--examples/declarative/particles/plasmapatrol/content/Hardpoint.qml38
1 files changed, 20 insertions, 18 deletions
diff --git a/examples/declarative/particles/plasmapatrol/content/Hardpoint.qml b/examples/declarative/particles/plasmapatrol/content/Hardpoint.qml
index c6af805856..62a6ceb2c5 100644
--- a/examples/declarative/particles/plasmapatrol/content/Hardpoint.qml
+++ b/examples/declarative/particles/plasmapatrol/content/Hardpoint.qml
@@ -53,7 +53,7 @@ Item {
property Item targetObj: null
property int damageDealt: 0
onDamageDealtChanged: dealDamageTimer.start();
- Timer{
+ Timer {
id: dealDamageTimer
interval: 16
running: false
@@ -62,49 +62,51 @@ Item {
}
width: 24
height: 24
- function fireAt(targetArg){//Each implement own
- if(targetArg != null){
+ function fireAt(targetArg) {//Each implement own
+ if (targetArg != null) {
hardpointLoader.item.fireAt(targetArg, container);
targetObj = targetArg;
}
}
- Loader{
+ Loader {
id: hardpointLoader
- sourceComponent: {switch(hardpointType){
- case 1: laserComponent; break;
- case 2: blasterComponent; break;
- case 3: cannonComponent; break;
- default: emptyComponent;
- }}
+ sourceComponent: {
+ switch (hardpointType) {
+ case 1: laserComponent; break;
+ case 2: blasterComponent; break;
+ case 3: cannonComponent; break;
+ default: emptyComponent;
+ }
+ }
}
- Component{
+ Component {
id: laserComponent
- LaserHardpoint{
+ LaserHardpoint {
target: container.target
system: container.system
show: container.show
}
}
- Component{
+ Component {
id: blasterComponent
- BlasterHardpoint{
+ BlasterHardpoint {
target: container.target
system: container.system
show: container.show
}
}
- Component{
+ Component {
id: cannonComponent
- CannonHardpoint{
+ CannonHardpoint {
target: container.target
system: container.system
show: container.show
}
}
- Component{
+ Component {
id: emptyComponent
Item {
- function fireAt(obj){
+ function fireAt(obj) {
console.log("Firing null weapon. It hurts.");
}
}