Changeset 741742de22a86c1b2732bd7d4c3e76ec274c34a6
- Timestamp:
- 01/01/08 11:52:07
(11 months ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1199184727 +0100
- git-parent:
[678b16a15b56fc4c1b3237d8eceb3250b0e873a9]
- git-author:
- Christopher Jung <bktheg@web.de> 1199184727 +0100
- Message:
ModuleSlots? wirft nun eine NoSuchSlotException? falls ein ungueltiger Slottyp abgerufen wird
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r087498f |
r741742d |
|
| 77 | 77 | for( int i=0, length=nodes.getLength(); i < length; i++ ) { |
|---|
| 78 | 78 | final String slot = XMLUtils.getStringAttribute(nodes.item(i), "id"); |
|---|
| 79 | | if( ModuleSlots.get().slot(slot) == null ) { |
|---|
| 80 | | throw new Exception("Item-Effekt Modul: Ungueltige Slot-ID '"+slot+"'"); |
|---|
| 81 | | } |
|---|
| | 79 | |
|---|
| | 80 | // Sicherstellen, dass der Slot existiert |
|---|
| | 81 | // sonst -> NoSuchSlotException |
|---|
| | 82 | ModuleSlots.get().slot(slot); |
|---|
| | 83 | |
|---|
| 82 | 84 | slots.add(slot); |
|---|
| 83 | 85 | } |
|---|
| r283e6c7 |
r741742d |
|
| 70 | 70 | * @param id Die ID des gewuenschten Modul-Slots |
|---|
| 71 | 71 | * @return Der Modul-Slot oder <code>null</code> |
|---|
| | 72 | * @throws NoSuchSlotException Falls der angeforderte Slottyp nicht existiert |
|---|
| 72 | 73 | */ |
|---|
| 73 | | public ModuleSlot slot( String id ) { |
|---|
| | 74 | public ModuleSlot slot( String id ) throws NoSuchSlotException { |
|---|
| | 75 | if( !list.containsKey(id) ) { |
|---|
| | 76 | throw new NoSuchSlotException(id); |
|---|
| | 77 | } |
|---|
| 74 | 78 | return list.get(id); |
|---|
| 75 | 79 | } |
|---|
| r953ed23 |
r741742d |
|
| 41 | 41 | import net.driftingsouls.ds2.server.config.Items; |
|---|
| 42 | 42 | import net.driftingsouls.ds2.server.config.ModuleSlots; |
|---|
| | 43 | import net.driftingsouls.ds2.server.config.NoSuchSlotException; |
|---|
| 43 | 44 | import net.driftingsouls.ds2.server.config.Rassen; |
|---|
| 44 | 45 | import net.driftingsouls.ds2.server.config.Weapon; |
|---|
| … | … | |
| 474 | 475 | targetslots.append(", "); |
|---|
| 475 | 476 | } |
|---|
| 476 | | if( ModuleSlots.get().slot(aslot) != null ) { |
|---|
| | 477 | try { |
|---|
| 477 | 478 | targetslots.append(ModuleSlots.get().slot(aslot).getName()); |
|---|
| | 479 | } |
|---|
| | 480 | catch( NoSuchSlotException e ) { |
|---|
| | 481 | targetslots.append("Ungueltiger Slot '"+aslot+"'"); |
|---|
| 478 | 482 | } |
|---|
| 479 | 483 | } |
|---|
| r327b751 |
r741742d |
|
| 27 | 27 | import net.driftingsouls.ds2.server.cargo.Resources; |
|---|
| 28 | 28 | import net.driftingsouls.ds2.server.config.ModuleSlots; |
|---|
| | 29 | import net.driftingsouls.ds2.server.config.NoSuchSlotException; |
|---|
| 29 | 30 | import net.driftingsouls.ds2.server.config.NoSuchWeaponException; |
|---|
| 30 | 31 | import net.driftingsouls.ds2.server.config.Rassen; |
|---|
| … | … | |
| 357 | 358 | for( int i=0; i < modulelist.length; i++ ) { |
|---|
| 358 | 359 | String[] amodule = StringUtils.split(modulelist[i],':'); |
|---|
| 359 | | if( ModuleSlots.get().slot(amodule[1]) != null ) { |
|---|
| | 360 | try { |
|---|
| 360 | 361 | moduletooltip.append(ModuleSlots.get().slot(amodule[1]).getName()); |
|---|
| 361 | 362 | moduletooltip.append("<br />"); |
|---|
| 362 | 363 | } |
|---|
| 363 | | else { |
|---|
| | 364 | catch( NoSuchSlotException e ) { |
|---|
| 364 | 365 | moduletooltip.append("<span style='color:red'>UNGUELTIGER SLOTTYP "); |
|---|
| 365 | 366 | moduletooltip.append(amodule[1]); |
|---|