Changeset fb878682f8828fd5291efd8c1bd70a39419ef685
- Timestamp:
- 08/18/07 14:09:23
(1 year ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1187438963 +0200
- git-parent:
[e626046e9f98e3c6c6244e98898a9ff2d8ab1e7d]
- git-author:
- Christopher Jung <bktheg@web.de> 1187438963 +0200
- Message:
Die ID eines Werftschlangeneintrags ist nun nicht mehr aus Position und Werft zusammengesetzt sondern ein kuenstlicher Schluessel
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r89d279c |
rfb87868 |
|
| 1 | 1 | CREATE TABLE `werft_queues` ( |
|---|
| 2 | | werft int NOT NULL, |
|---|
| 3 | | `position` int NOT NULL, |
|---|
| | 2 | `id` int(10) unsigned NOT NULL auto_increment, |
|---|
| | 3 | `werft` int(11) NOT NULL, |
|---|
| | 4 | `position` int(11) NOT NULL, |
|---|
| 4 | 5 | `building` int(11) default NULL, |
|---|
| 5 | 6 | `item` smallint(6) NOT NULL default '-1', |
|---|
| … | … | |
| 7 | 8 | `flagschiff` tinyint(1) unsigned NOT NULL default '0', |
|---|
| 8 | 9 | `costsPerTick` varchar(300) NOT NULL default '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', |
|---|
| 9 | | `energyPerTick` int NOT NULL default '0', |
|---|
| 10 | | `slots` INT NOT NULL DEFAULT '1', |
|---|
| 11 | | `scheduled` TINYINT( 1 ) NOT NULL DEFAULT '0', |
|---|
| 12 | | PRIMARY KEY (`werft`,`position`) |
|---|
| 13 | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
|---|
| | 10 | `energyPerTick` int(11) NOT NULL default '0', |
|---|
| | 11 | `slots` int(11) NOT NULL default '1', |
|---|
| | 12 | `scheduled` tinyint(1) NOT NULL default '0', |
|---|
| | 13 | PRIMARY KEY (`id`), |
|---|
| | 14 | UNIQUE KEY `queueentry` (`werft`,`position`), |
|---|
| | 15 | KEY `werft_queues_fk_ship_types` (`building`), |
|---|
| | 16 | KEY `werft` (`werft`) |
|---|
| | 17 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; |
|---|
| 14 | 18 | |
|---|
| 15 | 19 | ALTER TABLE werft_queues ADD CONSTRAINT werft_queues_fk_werften FOREIGN KEY (werft) REFERENCES werften(id); |
|---|
| r9689aa5 |
rfb87868 |
|
| 377 | 377 | ALTER TABLE `werften` ADD `komplex` TINYINT( 1 ) NOT NULL DEFAULT '0'; |
|---|
| 378 | 378 | ]]></update> |
|---|
| | 379 | <update type="structure" datum="2007-08-18"><![CDATA[ |
|---|
| | 380 | ALTER TABLE `werft_queues` ADD INDEX ( `werft` ); |
|---|
| | 381 | ALTER TABLE `werft_queues` DROP PRIMARY KEY; |
|---|
| | 382 | ALTER TABLE `werft_queues` ADD `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; |
|---|
| | 383 | ALTER TABLE `werft_queues` ADD UNIQUE `queueentry` ( `werft` , `position` ); |
|---|
| | 384 | ]]></update> |
|---|
| 379 | 385 | </updates> |
|---|
| r9689aa5 |
rfb87868 |
|
| 92 | 92 | private boolean buildFlagschiff = false; |
|---|
| 93 | 93 | private int type = 0; |
|---|
| 94 | | @ManyToOne(fetch=FetchType.LAZY) |
|---|
| | 94 | @ManyToOne(fetch=FetchType.EAGER) |
|---|
| 95 | 95 | @JoinColumn(name="linkedWerft", nullable=true) |
|---|
| 96 | 96 | private WerftKomplex linkedWerft = null; |
|---|
| … | … | |
| 118 | 118 | public WerftQueueEntry[] getScheduledQueueEntries() { |
|---|
| 119 | 119 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 120 | | List list = db.createQuery("from WerftQueueEntry where id.werft=? and scheduled=1 order by id.position") |
|---|
| | 120 | List list = db.createQuery("from WerftQueueEntry where werft=? and scheduled=1 order by position") |
|---|
| 121 | 121 | .setInteger(0, this.getWerftID()) |
|---|
| 122 | 122 | .list(); |
|---|
| … | … | |
| 137 | 137 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 138 | 138 | |
|---|
| 139 | | return db.createQuery("from WerftQueueEntry where id.werft=?") |
|---|
| | 139 | return db.createQuery("from WerftQueueEntry where werft=?") |
|---|
| 140 | 140 | .setInteger(0, this.getWerftID()) |
|---|
| 141 | 141 | .iterate().hasNext(); |
|---|
| … | … | |
| 157 | 157 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 158 | 158 | |
|---|
| 159 | | return ((Number)db.createQuery("select sum(slots) from WerftQueueEntry where id.werft=? and scheduled=1") |
|---|
| | 159 | return ((Number)db.createQuery("select sum(slots) from WerftQueueEntry where werft=? and scheduled=1") |
|---|
| 160 | 160 | .setInteger(0, this.getWerftID()) |
|---|
| 161 | 161 | .iterate().next()).intValue(); |
|---|
| … | … | |
| 226 | 226 | */ |
|---|
| 227 | 227 | protected void onFinishedBuildProcess(int shipid) { |
|---|
| | 228 | this.entries = null; |
|---|
| 228 | 229 | rescheduleQueue(); |
|---|
| 229 | 230 | } |
|---|
| … | … | |
| 259 | 260 | public void clearQueue() { |
|---|
| 260 | 261 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 261 | | db.createQuery("delete from WerftQueueEntry where id.werft=?") |
|---|
| | 262 | db.createQuery("delete from WerftQueueEntry where werft=?") |
|---|
| 262 | 263 | .setInteger(0, this.getWerftID()) |
|---|
| 263 | 264 | .executeUpdate(); |
|---|
| … | … | |
| 1421 | 1422 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 1422 | 1423 | |
|---|
| 1423 | | List queue = db.createQuery("from WerftQueueEntry where id.werft=? order by id.position asc") |
|---|
| | 1424 | List queue = db.createQuery("from WerftQueueEntry where werft=? order by position asc") |
|---|
| 1424 | 1425 | .setInteger(0, this.getWerftID()) |
|---|
| 1425 | 1426 | .list(); |
|---|
| … | … | |
| 1442 | 1443 | */ |
|---|
| 1443 | 1444 | public void cancelBuild(WerftQueueEntry entry) { |
|---|
| 1444 | | if( entry.getWerft() != this ) { |
|---|
| | 1445 | if( entry.getWerft().getWerftID() != this.getWerftID() ) { |
|---|
| 1445 | 1446 | throw new IllegalArgumentException("Das WerftQueue-Objekt gehoert nicht zu dieser Werft"); |
|---|
| 1446 | 1447 | } |
|---|
| … | … | |
| 1453 | 1454 | db.delete(entry); |
|---|
| 1454 | 1455 | |
|---|
| 1455 | | db.createQuery("update WerftQueueEntry set id.position=id.position-1 where id.werft=? and id.position>?") |
|---|
| 1456 | | .setInteger(0, this.id) |
|---|
| | 1456 | final Iterator entryIter = db.createQuery("from WerftQueueEntry where werft=? and position>? order by position") |
|---|
| | 1457 | .setEntity(0, entry.getWerft()) |
|---|
| 1457 | 1458 | .setInteger(1, entry.getPosition()) |
|---|
| 1458 | | .executeUpdate(); |
|---|
| | 1459 | .iterate(); |
|---|
| | 1460 | while( entryIter.hasNext() ) { |
|---|
| | 1461 | WerftQueueEntry aEntry = (WerftQueueEntry)entryIter.next(); |
|---|
| | 1462 | aEntry.setPosition(aEntry.getPosition()-1); |
|---|
| | 1463 | } |
|---|
| 1459 | 1464 | |
|---|
| 1460 | 1465 | this.entries = null; |
|---|
| | 1466 | this.rescheduleQueue(); |
|---|
| 1461 | 1467 | } |
|---|
| 1462 | 1468 | |
|---|
| … | … | |
| 1511 | 1517 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 1512 | 1518 | |
|---|
| 1513 | | return (WerftQueueEntry)db.createQuery("from WerftQueueEntry where id.werft=? and id.position=?") |
|---|
| | 1519 | return (WerftQueueEntry)db.createQuery("from WerftQueueEntry where werft=? and position=?") |
|---|
| 1514 | 1520 | .setInteger(0, this.getWerftID()) |
|---|
| 1515 | 1521 | .setInteger(1, position) |
|---|
| r27c1104 |
rfb87868 |
|
| 19 | 19 | package net.driftingsouls.ds2.server.werften; |
|---|
| 20 | 20 | |
|---|
| 21 | | import java.io.Serializable; |
|---|
| | 21 | import java.util.Iterator; |
|---|
| 22 | 22 | import java.util.List; |
|---|
| 23 | 23 | |
|---|
| 24 | 24 | import javax.persistence.Column; |
|---|
| 25 | | import javax.persistence.Embeddable; |
|---|
| 26 | 25 | import javax.persistence.Entity; |
|---|
| 27 | 26 | import javax.persistence.FetchType; |
|---|
| | 27 | import javax.persistence.GeneratedValue; |
|---|
| 28 | 28 | import javax.persistence.Id; |
|---|
| 29 | 29 | import javax.persistence.JoinColumn; |
|---|
| … | … | |
| 31 | 31 | import javax.persistence.Table; |
|---|
| 32 | 32 | import javax.persistence.Transient; |
|---|
| 33 | | |
|---|
| 34 | | import org.hibernate.annotations.Type; |
|---|
| 35 | 33 | |
|---|
| 36 | 34 | import net.driftingsouls.ds2.server.ContextCommon; |
|---|
| … | … | |
| 49 | 47 | import net.driftingsouls.ds2.server.ships.ShipTypeData; |
|---|
| 50 | 48 | |
|---|
| | 49 | import org.hibernate.annotations.Type; |
|---|
| | 50 | |
|---|
| 51 | 51 | /** |
|---|
| 52 | 52 | * Ein Eintrag in der WerftQueue |
|---|
| … | … | |
| 62 | 62 | @Transient |
|---|
| 63 | 63 | public final ContextLocalMessage MESSAGE = new ContextLocalMessage(); |
|---|
| 64 | | |
|---|
| 65 | | /** |
|---|
| 66 | | * Der Primaerschluessel eines WerftQueue-Eintrags |
|---|
| 67 | | * |
|---|
| 68 | | */ |
|---|
| 69 | | @Embeddable |
|---|
| 70 | | public static class Key implements Serializable { |
|---|
| 71 | | private static final long serialVersionUID = 3383104836435402919L; |
|---|
| 72 | | |
|---|
| 73 | | private int werft; |
|---|
| 74 | | private int position; |
|---|
| 75 | | |
|---|
| 76 | | /** |
|---|
| 77 | | * Konstruktor |
|---|
| 78 | | * |
|---|
| 79 | | */ |
|---|
| 80 | | public Key() { |
|---|
| 81 | | // EMPTY |
|---|
| 82 | | } |
|---|
| 83 | | |
|---|
| 84 | | /** |
|---|
| 85 | | * Erstellt einen neuen Schluessel |
|---|
| 86 | | * @param werft Die Werft |
|---|
| 87 | | * @param position Die Position |
|---|
| 88 | | */ |
|---|
| 89 | | public Key(WerftObject werft, int position) { |
|---|
| 90 | | this.werft = werft.getWerftID(); |
|---|
| 91 | | this.position = position; |
|---|
| 92 | | } |
|---|
| 93 | | |
|---|
| 94 | | /** |
|---|
| 95 | | * Gibt die Position zurueck |
|---|
| 96 | | * @return Die Position |
|---|
| 97 | | */ |
|---|
| 98 | | public int getPosition() { |
|---|
| 99 | | return position; |
|---|
| 100 | | } |
|---|
| 101 | | |
|---|
| 102 | | /** |
|---|
| 103 | | * Gibt die Werft zurueck |
|---|
| 104 | | * @return Die Werft |
|---|
| 105 | | */ |
|---|
| 106 | | public WerftObject getWerft() { |
|---|
| 107 | | return (WerftObject)ContextMap.getContext().getDB().get(WerftObject.class,werft); |
|---|
| 108 | | } |
|---|
| 109 | | |
|---|
| 110 | | @Override |
|---|
| 111 | | public int hashCode() { |
|---|
| 112 | | int result = 1; |
|---|
| 113 | | result = 31 * result + position; |
|---|
| 114 | | result = 31 * result + werft; |
|---|
| 115 | | |
|---|
| 116 | | return result; |
|---|
| 117 | | } |
|---|
| 118 | | |
|---|
| 119 | | @Override |
|---|
| 120 | | public boolean equals(Object obj) { |
|---|
| 121 | | if( this == obj ) { |
|---|
| 122 | | return true; |
|---|
| 123 | | } |
|---|
| 124 | | if( (obj == null) || (getClass() != obj.getClass()) ) { |
|---|
| 125 | | return false; |
|---|
| 126 | | } |
|---|
| 127 | | |
|---|
| 128 | | final Key other = (Key)obj; |
|---|
| 129 | | if( position != other.position ) { |
|---|
| 130 | | return false; |
|---|
| 131 | | } |
|---|
| 132 | | else if( werft != other.werft ) { |
|---|
| 133 | | return false; |
|---|
| 134 | | } |
|---|
| 135 | | return true; |
|---|
| 136 | | } |
|---|
| 137 | | } |
|---|
| 138 | | |
|---|
| 139 | | @Id |
|---|
| 140 | | private Key id; |
|---|
| | 64 | |
|---|
| | 65 | @Id @GeneratedValue |
|---|
| | 66 | private int id; |
|---|
| | 67 | @ManyToOne(fetch=FetchType.EAGER) |
|---|
| | 68 | @JoinColumn(name="werft", nullable=false) |
|---|
| | 69 | private WerftObject werft; |
|---|
| | 70 | private int position; |
|---|
| 141 | 71 | @ManyToOne(fetch=FetchType.LAZY) |
|---|
| 142 | 72 | @JoinColumn(name="building", nullable=false) |
|---|
| … | … | |
| 171 | 101 | */ |
|---|
| 172 | 102 | public WerftQueueEntry(WerftObject werft, ShipType building, int remaining, int slots) { |
|---|
| 173 | | this.id = new Key(werft, getNextEmptyPosition(werft)); |
|---|
| | 103 | this.werft = werft; |
|---|
| | 104 | this.position = getNextEmptyPosition(werft); |
|---|
| 174 | 105 | this.building = building; |
|---|
| 175 | 106 | this.buildItem = -1; |
|---|
| … | … | |
| 195 | 126 | org.hibernate.Session db = ContextMap.getContext().getDB(); |
|---|
| 196 | 127 | |
|---|
| 197 | | Integer position = (Integer)db.createQuery("select max(wq.id.position) from WerftQueueEntry as wq where wq.id.werft=?") |
|---|
| | 128 | Integer position = (Integer)db.createQuery("select max(wq.position) from WerftQueueEntry as wq where wq.werft=?") |
|---|
| 198 | 129 | .setInteger(0, werft.getWerftID()) |
|---|
| 199 | 130 | .iterate().next(); |
|---|
| … | … | |
| 203 | 134 | } |
|---|
| 204 | 135 | return position+1; |
|---|
| | 136 | } |
|---|
| | 137 | |
|---|
| | 138 | /** |
|---|
| | 139 | * Gibt die Id zurueck |
|---|
| | 140 | * @return Die Id |
|---|
| | 141 | */ |
|---|
| | 142 | public int getId() { |
|---|
| | 143 | return this.id; |
|---|
| 205 | 144 | } |
|---|
| 206 | 145 | |
|---|
| … | … | |
| 228 | 167 | */ |
|---|
| 229 | 168 | public WerftObject getWerft() { |
|---|
| 230 | | return this.id.getWerft(); |
|---|
| | 169 | return this.werft; |
|---|
| 231 | 170 | } |
|---|
| 232 | 171 | |
|---|
| … | … | |
| 236 | 175 | */ |
|---|
| 237 | 176 | public int getPosition() { |
|---|
| 238 | | return this.id.getPosition(); |
|---|
| 239 | | } |
|---|
| 240 | | |
|---|
| | 177 | return this.position; |
|---|
| | 178 | } |
|---|
| | 179 | |
|---|
| | 180 | /** |
|---|
| | 181 | * Setzt die Position des Eintrags innerhalb der Bauschlange. Jede Position |
|---|
| | 182 | * darf nur einmal vergeben sein. |
|---|
| | 183 | * @param position Die Position innerhalb der Bauschlange |
|---|
| | 184 | */ |
|---|
| | 185 | public void setPosition(int position) { |
|---|
| | 186 | this.position = position; |
|---|
| | 187 | } |
|---|
| | 188 | |
|---|
| 241 | 189 | /** |
|---|
| 242 | 190 | * Gibt zurueck, ob es sich bei dem Bau um ein Flagschiff handelt |
|---|
| … | … | |
| 386 | 334 | ShipTypeData shipd = this.getBuildShipType(); |
|---|
| 387 | 335 | |
|---|
| 388 | | WerftObject werft = id.getWerft(); |
|---|
| 389 | | int x = werft.getX(); |
|---|
| 390 | | int y = werft.getY(); |
|---|
| 391 | | int system = werft.getSystem(); |
|---|
| | 336 | int x = this.werft.getX(); |
|---|
| | 337 | int y = this.werft.getY(); |
|---|
| | 338 | int system = this.werft.getSystem(); |
|---|
| 392 | 339 | |
|---|
| 393 | 340 | Cargo cargo = new Cargo(); |
|---|
| 394 | | User auser = werft.getOwner(); |
|---|
| | 341 | User auser = this.werft.getOwner(); |
|---|
| 395 | 342 | |
|---|
| 396 | 343 | String currentTime = Common.getIngameTime(context.get(ContextCommon.class).getTick()); |
|---|
| … | … | |
| 428 | 375 | // Item benutzen |
|---|
| 429 | 376 | if( this.getRequiredItem() > -1 ) { |
|---|
| 430 | | cargo = werft.getCargo(true); |
|---|
| | 377 | cargo = this.werft.getCargo(true); |
|---|
| 431 | 378 | List<ItemCargoEntry> itemlist = cargo.getItem(this.getRequiredItem()); |
|---|
| 432 | 379 | boolean ok = false; |
|---|
| … | … | |
| 439 | 386 | |
|---|
| 440 | 387 | if( !ok ) { |
|---|
| 441 | | User user = werft.getOwner(); |
|---|
| | 388 | User user = this.werft.getOwner(); |
|---|
| 442 | 389 | |
|---|
| 443 | 390 | Cargo allyitems = null; |
|---|
| … | … | |
| 468 | 415 | |
|---|
| 469 | 416 | if( source.equals("local") ) { |
|---|
| 470 | | werft.setCargo(cargo, true); |
|---|
| | 417 | this.werft.setCargo(cargo, true); |
|---|
| 471 | 418 | } |
|---|
| 472 | 419 | else { |
|---|
| 473 | 420 | db.createQuery("update Ally as a set a.items=? where a.id=?") |
|---|
| 474 | 421 | .setString(0, allyitems.getData(Cargo.Type.ITEMSTRING)) |
|---|
| 475 | | .setInteger(1, werft.getOwner().getAlly().getId()) |
|---|
| | 422 | .setInteger(1, this.werft.getOwner().getAlly().getId()) |
|---|
| 476 | 423 | .executeUpdate(); |
|---|
| 477 | 424 | } |
|---|
| … | … | |
| 483 | 430 | |
|---|
| 484 | 431 | if( this.isBuildFlagschiff() ) { |
|---|
| 485 | | werft.setBuildFlagschiff(false); |
|---|
| | 432 | this.werft.setBuildFlagschiff(false); |
|---|
| 486 | 433 | } |
|---|
| 487 | 434 | |
|---|
| 488 | 435 | db.delete(this); |
|---|
| 489 | | db.createQuery("update WerftQueueEntry set id.position=id.position-1 where id.werft=?") |
|---|
| 490 | | .setInteger(0, werft.getWerftID()) |
|---|
| 491 | | .executeUpdate(); |
|---|
| 492 | | |
|---|
| 493 | | werft.onFinishedBuildProcess(id); |
|---|
| | 436 | final Iterator entryIter = db.createQuery("from WerftQueueEntry where werft=? and position>? order by position") |
|---|
| | 437 | .setEntity(0, this.werft) |
|---|
| | 438 | .setInteger(1, this.position) |
|---|
| | 439 | .iterate(); |
|---|
| | 440 | while( entryIter.hasNext() ) { |
|---|
| | 441 | WerftQueueEntry entry = (WerftQueueEntry)entryIter.next(); |
|---|
| | 442 | entry.setPosition(entry.getPosition()-1); |
|---|
| | 443 | } |
|---|
| | 444 | |
|---|
| | 445 | this.werft.onFinishedBuildProcess(id); |
|---|
| 494 | 446 | |
|---|
| 495 | 447 | return id; |
|---|
| … | … | |
| 507 | 459 | return true; |
|---|
| 508 | 460 | } |
|---|
| 509 | | |
|---|
| 510 | | WerftObject werft = id.getWerft(); |
|---|
| 511 | | |
|---|
| | 461 | |
|---|
| 512 | 462 | // Pruefen, ob ein evt notwendiges Item vorhanden ist |
|---|
| 513 | 463 | if( this.getRequiredItem() > -1 ) { |
|---|
| 514 | | Cargo cargo = new Cargo(werft.getCargo(true)); |
|---|
| 515 | | User user = werft.getOwner(); |
|---|
| | 464 | Cargo cargo = new Cargo(this.werft.getCargo(true)); |
|---|
| | 465 | User user = this.werft.getOwner(); |
|---|
| 516 | 466 | |
|---|
| 517 | 467 | if( user.getAlly() != null ) { |
|---|
| … | … | |
| 528 | 478 | // Pruefen, ob die anfallenden Baukosten bezahlt werden koennen |
|---|
| 529 | 479 | if( !this.getCostsPerTick().isEmpty() ) { |
|---|
| 530 | | Cargo cargo = new Cargo(werft.getCargo(false)); |
|---|
| | 480 | Cargo cargo = new Cargo(this.werft.getCargo(false)); |
|---|
| 531 | 481 | ResourceList reslist = this.costsPerTick.compare(cargo, false); |
|---|
| 532 | 482 | for( ResourceEntry res : reslist ) { |
|---|
| … | … | |
| 538 | 488 | |
|---|
| 539 | 489 | if( this.getEnergyPerTick() != 0 ) { |
|---|
| 540 | | if( werft.getEnergy() < this.getEnergyPerTick() ) { |
|---|
| | 490 | if( this.werft.getEnergy() < this.getEnergyPerTick() ) { |
|---|
| 541 | 491 | return false; |
|---|
| 542 | 492 | } |
|---|
| … | … | |
| 547 | 497 | |
|---|
| 548 | 498 | private void substractBuildCosts() { |
|---|
| 549 | | WerftObject werft = id.getWerft(); |
|---|
| 550 | | |
|---|
| 551 | 499 | if( !this.getCostsPerTick().isEmpty() ) { |
|---|
| 552 | | Cargo cargo = werft.getCargo(false); |
|---|
| | 500 | Cargo cargo = this.werft.getCargo(false); |
|---|
| 553 | 501 | cargo.substractCargo(this.getCostsPerTick()); |
|---|
| 554 | | werft.setCargo(cargo, false); |
|---|
| | 502 | this.werft.setCargo(cargo, false); |
|---|
| 555 | 503 | } |
|---|
| 556 | 504 | |
|---|
| 557 | 505 | if( this.getEnergyPerTick() != 0 ) { |
|---|
| 558 | | werft.setEnergy(werft.getEnergy() - this.getEnergyPerTick()); |
|---|
| | 506 | this.werft.setEnergy(this.werft.getEnergy() - this.getEnergyPerTick()); |
|---|
| 559 | 507 | } |
|---|
| 560 | 508 | } |
|---|