You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2006-09-04 17:32:07
|
Revision: 309 http://svn.sourceforge.net/gridarta/?rev=309&view=rev Author: akirschbaum Date: 2006-09-04 10:32:02 -0700 (Mon, 04 Sep 2006) Log Message: ----------- Make variable final. Modified Paths: -------------- trunk/daimonin/src/daieditor/CopyBuffer.java Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-08-31 17:58:08 UTC (rev 308) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-09-04 17:32:02 UTC (rev 309) @@ -198,7 +198,6 @@ mapControl.getMapModel().beginTransaction(); final Point pos = new Point(); assert copyMap != null; - ArchObject clone; for (final MapSquare square : copyMap) { pos.setLocation(startp.x + square.getMapX(), startp.y + square.getMapY()); // paste the archs if on the map: @@ -206,7 +205,7 @@ for (final ArchObject arch : square) { if (!arch.isMulti()) { // read arch from buffer and stick in on the map - clone = arch.createClone(pos.x, pos.y); + final ArchObject clone = arch.createClone(pos.x, pos.y); mapControl.getMapModel().addArchObjectToMap(clone, false); } } @@ -221,7 +220,7 @@ for (final ArchObject arch : square) { if (arch.getMultiRefCount() > 0) { // first we clone the head - clone = arch.createClone(pos.x, pos.y); + final ArchObject clone = arch.createClone(pos.x, pos.y); // second we insert a default multi on the map if (mapControl.getMapModel().addArchToMap(arch.getArchName(), pos, true, false)) { // third we chop off the default head and attach our clone This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-08-31 17:59:55
|
Revision: 308 http://svn.sourceforge.net/gridarta/?rev=308&view=rev Author: akirschbaum Date: 2006-08-31 10:58:08 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Update archetypes information. Modified Paths: -------------- trunk/crossfire/CHANGES.txt trunk/crossfire/resource/conf/archetypes trunk/crossfire/resource/conf/crossfire.0 trunk/crossfire/resource/conf/treasures Modified: trunk/crossfire/CHANGES.txt =================================================================== --- trunk/crossfire/CHANGES.txt 2006-08-28 22:05:59 UTC (rev 307) +++ trunk/crossfire/CHANGES.txt 2006-08-31 17:58:08 UTC (rev 308) @@ -1016,3 +1016,9 @@ Prevent crash when saving inventory objects having a msg...endmsg field. Andreas Kirschbaum + +--- 31/08/2006 --- + +Update archetypes information. + +Andreas Kirschbaum Modified: trunk/crossfire/resource/conf/archetypes =================================================================== --- trunk/crossfire/resource/conf/archetypes 2006-08-28 22:05:59 UTC (rev 307) +++ trunk/crossfire/resource/conf/archetypes 2006-08-31 17:58:08 UTC (rev 308) @@ -149,6 +149,7 @@ editable 5120 body_foot -2 item_power 1 +map_layer item editor_folder armour/boots end Object low_boots @@ -4505,6 +4506,7 @@ speed 0.50 editable 2 no_pick 1 +client_anim_random 1 editor_folder construct/fountain end Object darkhold @@ -8685,6 +8687,8 @@ face bone_head.111 type 98 invisible 1 +no_pick 1 +no_drop 1 editor_folder disease end Object incontinence @@ -14043,7 +14047,7 @@ msg Putting this shell to your ear, you hear a strange and haunting melody. - endmsg +endmsg type 35 level 40 value 590 @@ -15532,6 +15536,25 @@ smoothlevel 24 editor_folder ground/Winter end +Object evil_ice +type 102 +subtype 7 +level 1 +walk_on 1 +wc -30 +lifesave 1 +name strange looking ice +face evil_ice.111 +animation evil_ice +speed 0.2 +no_pick 1 +attacktype 16 +hp 1 +dam 10 +editable 8 +is_floor 1 +editor_folder ground/Winter +end Object glacier name glacier face glacier.111 @@ -16594,6 +16617,7 @@ editable 8 is_floor 1 smoothlevel 20 +client_anim_sync 1 editor_folder ground end Object sea1 @@ -16606,6 +16630,7 @@ editable 8 is_floor 1 smoothlevel 20 +client_anim_sync 1 editor_folder ground end Object sea_nw @@ -19816,6 +19841,33 @@ editable 128 editor_folder misc/Camp end +Object campfire_talking +name talking campfire +randomitems campfire_talking +face campfire.111 +type 73 +animation campfire_talking +glow_radius 2 +no_pick 1 +editable 128 +speed -0.3 +is_animated 1 +editor_folder misc/Camp +end +Object campfire_say +type 116 +subtype 6 +title Python +slaying /python/items/campfire_say.py +editor_folder misc/Camp +end +Object campfire_timer +type 116 +subtype 12 +title Python +slaying /python/items/campfire_timer.py +editor_folder misc/Camp +end Object campfire_out name old campfire face campfire_out.111 @@ -29854,7 +29906,7 @@ Object goblin randomitems goblin race goblin -face goblin.111 +face goblin.151 animation goblin monster 1 sleep 1 @@ -32764,7 +32816,8 @@ @match * I'm too busy to answer your queries. endmsg -face sage.111 +face sage.151 +animation c_sage Pow 5 Int 25 Dex 5 @@ -33665,7 +33718,8 @@ @match * I'm too busy to answer your queries. endmsg -face sage.111 +face sage.151 +animation sage Pow 5 Dex 5 Int 20 @@ -46211,7 +46265,7 @@ Object manabolt type 102 subtype 4 -face destruction.111 +face manabolt.111 animation manabolt flying 1 speed 1 @@ -46639,6 +46693,22 @@ editable 0 editor_folder spell/Bullet/Shell end +Object asteroid +other_arch snowstorm +type 102 +subtype 5 +face asteroid.112 +animation asteroid +is_animated 0 +is_turnable 1 +walk_on 1 +fly_on 1 +flying 1 +speed 1 +editable 0 +no_pick 1 +editor_folder spell/Bullet +end Object bullet type 102 subtype 5 @@ -46678,7 +46748,7 @@ Object cause_wounds type 102 subtype 5 -face healing.111 +face cause.111 animation cause_wounds is_animated 1 is_turnable 0 @@ -46747,7 +46817,7 @@ name uncontrolled mana type 102 subtype 6 -face destruction.111 +face manabolt.111 animation loose_magic speed 1 range 3 @@ -46762,7 +46832,7 @@ Object manaball type 102 subtype 6 -face destruction.111 +face manabolt.111 animation manaball hp 4 wc -50 @@ -46880,6 +46950,34 @@ attacktype 16 editor_folder spell/Bullet end +Object spell_asteroid +name asteroid +name_pl asteroid +face spell_evocation.111 +level 8 +value 80 +sp 15 +casting_time 10 +path_attuned 16 +other_arch asteroid +dam 75 +dam_modifier 1 +range 12 +duration 10 +duration_modifier 4 +maxsp 18 +type 101 +subtype 5 +attacktype 256 +no_drop 1 +invisible 1 +skill evocation +food 10 +msg +Info. +endmsg +editor_folder spell/Bullet +end Object spell_magic_bullet name magic bullet name_pl magic bullet @@ -48483,7 +48581,7 @@ subtype 7 walk_on 1 fly_on 1 -face destruction.111 +face manabolt.111 animation manablast speed 1 wc -50 @@ -51748,7 +51846,7 @@ other_arch divine_shock dam 1 dam_modifier 3 -duration 1 +duration 10 duration_modifier 4 maxgrace 5 attacktype 1048584 @@ -53083,7 +53181,7 @@ name godly retribution type 102 subtype 6 -face destruction.111 +face manabolt.111 animation god_power speed 1 range 4 @@ -53619,6 +53717,29 @@ invisible 1 editor_folder spell/Swarm end +Object spell_frost_nova +name frost nova +name_pl frost nova +face spell_evocation.111 +skill evocation +type 101 +subtype 36 +level 12 +value 120 +sp 30 +casting_time 12 +path_attuned 16 +other_arch spell_asteroid +duration 3 +duration_modifier 4 +maxsp 12 +no_drop 1 +invisible 1 +msg +Info on Frost Nova. +endmsg +editor_folder spell/Swarm +end Object spell_meteor_swarm name meteor swarm name_pl meteor swarm @@ -54097,6 +54218,11 @@ subtype 3 editor_folder system end +Object event_destroy +type 116 +subtype 13 +editor_folder system +end Object event_drop type 116 subtype 4 @@ -54127,7 +54253,7 @@ subtype 8 editor_folder system end -Object event_throw +Object event_timer type 116 subtype 12 editor_folder system @@ -54147,6 +54273,7 @@ Object map type 22 slaying /HallOfSelection +race /start/HallsOfSelection face map.111 x 16 y 16 @@ -55165,6 +55292,7 @@ level 1 face bul_wall_0.111 speed -0.4 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55180,6 +55308,7 @@ face bul_wall_1.111 sp 1 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55195,6 +55324,7 @@ face bul_wall_2.111 sp 2 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55210,6 +55340,7 @@ face bul_wall_3.111 sp 3 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55225,6 +55356,7 @@ face bul_wall_4.111 sp 4 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55240,6 +55372,7 @@ face bul_wall_5.111 sp 5 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55255,6 +55388,7 @@ face bul_wall_6.111 sp 6 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55270,6 +55404,7 @@ face bul_wall_7.111 sp 7 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55285,6 +55420,7 @@ face bul_wall_8.111 sp 8 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -55503,6 +55639,7 @@ resist_drain 100 no_pick 1 +no_pass 1 blocksview 1 alive 1 level 1 @@ -57655,6 +57792,7 @@ sp 1 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57671,6 +57809,7 @@ sp 2 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57687,6 +57826,7 @@ sp 3 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57703,6 +57843,7 @@ sp 4 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57719,6 +57860,7 @@ sp 5 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57735,6 +57877,7 @@ sp 6 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57751,6 +57894,7 @@ sp 7 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -57767,6 +57911,7 @@ sp 8 dam 1 speed -0.02 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58272,6 +58417,7 @@ name hedge face hedge_0.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58280,6 +58426,7 @@ name hedge face hedge_1.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58288,6 +58435,7 @@ name hedge face hedge_2.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58296,6 +58444,7 @@ name hedge face hedge_3.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58304,6 +58453,7 @@ name hedge face hedge_4.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58312,6 +58462,7 @@ name hedge face hedge_5.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58320,6 +58471,7 @@ name hedge face hedge_6.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58328,6 +58480,7 @@ name hedge face hedge_7.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58336,6 +58489,7 @@ name hedge face hedge_8.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58344,6 +58498,7 @@ name hedge face hedge_9.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58352,6 +58507,7 @@ name hedge face hedge_A.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58360,6 +58516,7 @@ name hedge face hedge_B.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58368,6 +58525,7 @@ name hedge face hedge_C.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58376,6 +58534,7 @@ name hedge face hedge_D.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58384,6 +58543,7 @@ name hedge face hedge_E.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58392,6 +58552,7 @@ name hedge face hedge_F.111 blocksview 1 +no_pick 1 is_wooded 1 editable 512 editor_folder wall/hedge @@ -58567,6 +58728,7 @@ animation lbulletwall is_animated 0 speed -0.16 +no_pick 1 no_pass 1 dam 29 blocksview 1 @@ -58584,6 +58746,7 @@ sp 1 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58600,6 +58763,7 @@ sp 2 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58616,6 +58780,7 @@ sp 3 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58632,6 +58797,7 @@ sp 4 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58648,6 +58814,7 @@ sp 5 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58664,6 +58831,7 @@ sp 6 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58680,6 +58848,7 @@ sp 7 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58696,6 +58865,7 @@ sp 8 dam 29 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58711,6 +58881,7 @@ dam 5 face light_wall.101 speed -0.1 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58730,6 +58901,7 @@ dam 5 is_animated 0 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58746,6 +58918,7 @@ sp 1 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58761,6 +58934,7 @@ face light_wall.121 sp 2 speed -0.04 +no_pick 1 no_pass 1 dam 5 blocksview 1 @@ -58778,6 +58952,7 @@ sp 3 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58794,6 +58969,7 @@ sp 4 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58810,6 +58986,7 @@ sp 5 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58826,6 +59003,7 @@ sp 6 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58842,6 +59020,7 @@ sp 7 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -58858,6 +59037,7 @@ sp 8 dam 5 speed -0.04 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -60131,6 +60311,7 @@ animation speedballwall dam 56 speed -0.03 +no_pick 1 no_pass 1 blocksview 1 editable 32 @@ -60299,6 +60480,7 @@ Object swall_0 name wall face swall_0.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60306,6 +60488,7 @@ Object swall_1_2 name wall face swall_1.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60313,6 +60496,7 @@ Object swall_1_2_half name wall face swall_1_half.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60320,6 +60504,7 @@ Object swall_1_4 name wall face swall_2.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60327,6 +60512,7 @@ Object swall_1_4_half name wall face swall_2_half.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60334,6 +60520,7 @@ Object swall_2_2_1 name wall face swall_3.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60341,6 +60528,7 @@ Object swall_1_1 name wall face swall_4.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60348,6 +60536,7 @@ Object swall_1_1_half name wall face swall_4_half.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60355,6 +60544,7 @@ Object swall_2_1_1 name wall face swall_5.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60362,6 +60552,7 @@ Object swall_2_2_2 name wall face swall_6.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60369,6 +60560,7 @@ Object swall_3_2 name wall face swall_7.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60376,6 +60568,7 @@ Object swall_1_3 name wall face swall_8.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60383,6 +60576,7 @@ Object swall_1_3_half name wall face swall_8_half.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60390,6 +60584,7 @@ Object swall_2_2_4 name wall face swall_9.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60397,6 +60592,7 @@ Object swall_2_1_2 name wall face swall_A.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60404,6 +60600,7 @@ Object swall_3_1 name wall face swall_B.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60411,6 +60608,7 @@ Object swall_2_2_3 name wall face swall_C.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60418,6 +60616,7 @@ Object swall_3_4 name wall face swall_D.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60425,6 +60624,7 @@ Object swall_3_3 name wall face swall_E.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall @@ -60432,6 +60632,7 @@ Object swall_4 name wall face swall_F.111 +no_pick 1 no_pass 1 editable 512 editor_folder wall/swall Modified: trunk/crossfire/resource/conf/crossfire.0 =================================================================== (Binary files differ) Modified: trunk/crossfire/resource/conf/treasures =================================================================== --- trunk/crossfire/resource/conf/treasures 2006-08-28 22:05:59 UTC (rev 307) +++ trunk/crossfire/resource/conf/treasures 2006-08-31 17:58:08 UTC (rev 308) @@ -6,7 +6,7 @@ # # This file contains various treasures, with generation rules. # -# $Id: treasures,v 1.9 2006/02/22 22:05:07 akirschbaum Exp $ +# $Id: treasures,v 1.87 2005/12/10 10:37:32 ryo_saeba Exp $ # # As of version 0.91.1, what this file was extended to handle list # re-linking and generation of only 1 item on that list. This does away @@ -4743,6 +4743,11 @@ arch building_mouthbook chance 2 end +treasure campfire_talking + arch campfire_say + more + arch campfire_timer +end treasure gps arch gps_event end @@ -4873,8 +4878,10 @@ more arch ring chance 90 - nrof 2 more + arch ring + chance 50 + more arch cloak end treasure leech @@ -4900,8 +4907,10 @@ more arch ring chance 90 - nrof 2 more + arch ring + chance 50 + more arch cloak more arch mithril_chainmail @@ -5146,8 +5155,10 @@ more arch ring chance 90 - nrof 2 more + arch ring + chance 50 + more arch cloak end treasure DK @@ -5581,7 +5592,7 @@ arch skill_karate end end -# note: punching and throwing arent good +# note: punching and throwing aren't good # combination to give to NPC's. They wind # throwing away their melee weapons! treasure pirate This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 22:06:25
|
Revision: 307 Author: christianhujer Date: 2006-08-28 15:05:59 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=307&view=rev Log Message: ----------- Fixed some Serialization issues. Modified Paths: -------------- trunk/daimonin/src/daieditor/MultiArchData.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/arch/ArchObject.java trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java trunk/daimonin/src/daieditor/arch/NamedObject.java trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java trunk/daimonin/src/daieditor/arch/face/FaceObject.java trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/src/app/net/sf/gridarta/Size2D.java Modified: trunk/daimonin/src/daieditor/MultiArchData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiArchData.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/MultiArchData.java 2006-08-28 22:05:59 UTC (rev 307) @@ -27,6 +27,7 @@ import daieditor.arch.ArchObject; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import org.jetbrains.annotations.Nullable; /** @@ -37,8 +38,11 @@ * a little bit of memory. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class MultiArchData { +public final class MultiArchData implements Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + private boolean referenced; // true: this arch is a part of the tail - NOT the head private int refx; // multi tile: offset pos from head Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-08-28 22:05:59 UTC (rev 307) @@ -33,6 +33,7 @@ import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; +import java.io.Serializable; import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.Box; @@ -59,8 +60,11 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @XXX This class is designed very badly, as it combines model and presentation. */ -public final class ScriptArchData { +public final class ScriptArchData implements Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** ActionFactory. */ private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-28 22:05:59 UTC (rev 307) @@ -38,6 +38,7 @@ import daieditor.map.MapSquare; import java.util.Collections; import java.util.List; +import java.io.Serializable; import javax.swing.ImageIcon; import javax.swing.JList; import org.jetbrains.annotations.Nullable; @@ -56,8 +57,11 @@ * normal arches. * @todo this class is not always the best place for multipart object handling, see also {@link ArchObjectContainer} for issues about this */ -public final class ArchObject /*extends NamedObject*/ extends ArchObjectContainer implements Cloneable, net.sf.gridarta.arch.ArchObject { +public final class ArchObject /*extends NamedObject*/ extends ArchObjectContainer implements Cloneable, net.sf.gridarta.arch.ArchObject, Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** Special constant that's used if an arch has no arch type set. */ public static final int TYPE_UNSET = -666; @@ -158,7 +162,6 @@ /** The transparent face. */ private ImageIcon transFace; - /** Create an ArchObject. */ public ArchObject() { archText = new StringBuffer(); Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-28 22:05:59 UTC (rev 307) @@ -26,6 +26,10 @@ import java.util.List; import java.util.ArrayList; import java.util.ListIterator; +import java.io.Serializable; +import java.io.ObjectInputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; @@ -40,8 +44,11 @@ * @todo: In case of MapSquares, this class is most likely bogus regarding multipart objects. This needs to be fixed. */ @SuppressWarnings({"ClassReferencesSubclass"}) -public abstract class ArchObjectContainer implements Iterable<ArchObject> { +public abstract class ArchObjectContainer implements Iterable<ArchObject>, Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** * The contents of this container. * @note the order of this container is bottom to top. @@ -49,10 +56,10 @@ @NotNull private List<ArchObject> contents; /** Iterable implementation for recursice traversal. */ - @NotNull private Iterable<ArchObject> recursive; + @NotNull private transient Iterable<ArchObject> recursive; /** Iterable implementation for reverse traversal. */ - @NotNull private Iterable<ArchObject> reverse; + @NotNull private transient Iterable<ArchObject> reverse; /** Create a new ArchObjectContainer. */ protected ArchObjectContainer() { @@ -346,6 +353,14 @@ } } + /** {@inheritDoc} */ + // writeObject() is not required because this class doesn't require special handling during serialization. + private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + // initialize transients + initData(); + } + /** * An iterator for iterating over a list in reverse order. * @todo move this class to JAPI Modified: trunk/daimonin/src/daieditor/arch/NamedObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/NamedObject.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/arch/NamedObject.java 2006-08-28 22:05:59 UTC (rev 307) @@ -22,6 +22,7 @@ package daieditor.arch; import javax.swing.ImageIcon; +import java.io.Serializable; /** * A <code>NamedObject</code> has a name and tree position source and provides an icon for display. @@ -29,11 +30,14 @@ * {@link daieditor.arch.anim.AnimationObject}. * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> */ -public abstract class NamedObject implements Comparable<NamedObject> { +public abstract class NamedObject implements Comparable<NamedObject>, Serializable { /** The Path. */ private String path; + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** * Create a NamedObject. * @param path Path Modified: trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java 2006-08-28 22:05:59 UTC (rev 307) @@ -24,7 +24,6 @@ /** * Exception that's thrown in case a face name was not unique. * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - * @serial exclude */ public class DuplicateFaceException extends Exception { Modified: trunk/daimonin/src/daieditor/arch/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/FaceObject.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/arch/face/FaceObject.java 2006-08-28 22:05:59 UTC (rev 307) @@ -23,6 +23,7 @@ import daieditor.arch.NamedObject; import javax.swing.ImageIcon; +import java.io.Serializable; /** * A FaceObject stores information and meta information about a face and provides methods for accessing these. @@ -36,7 +37,6 @@ * <li>File size</li> * </ul> * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - * @todo this class should be Serializable because it's used as an Exception field. * @todo think how this class could be serialized because size, offset etc. are not serializable. */ public class FaceObject extends NamedObject { Modified: trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java 2006-08-28 22:05:59 UTC (rev 307) @@ -22,12 +22,13 @@ package daieditor.arch.match; import daieditor.arch.ArchObject; +import java.io.Serializable; /** * Interface for classes that match ArchObjects. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface ArchObjectMatcher { +public interface ArchObjectMatcher extends Serializable { /** * Match an ArchObject. Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-08-28 22:05:59 UTC (rev 307) @@ -36,6 +36,8 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; +import java.io.IOException; +import java.io.ObjectInputStream; import javax.swing.event.EventListenerList; import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; @@ -63,7 +65,7 @@ private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Sync Lock Object. */ - private final Object syncLock = new Object(); + private final transient Object syncLock = new Object(); /** The registered event listeners. */ private EventListenerList listenerList = new EventListenerList(); @@ -90,11 +92,12 @@ * The CMainControl used for various operations. * @deprecated it's not a good idea to require the MapModel implementation to know such a heavy-weight strongly UI-related glue class like {@link CMainControl}. */ - @Deprecated private final CMainControl mainControl; + @Deprecated private final transient CMainControl mainControl; /** * The MapControl that controls this MapModel. * @deprecated it's not a good idea to require the MapModel implementation to know such a heavy-weight strongly UI-related glue class like {@link CMapControl}. + * @todo care about Serialization if this field remains */ @Deprecated private final MapControl mapControl; Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-08-28 22:05:59 UTC (rev 307) @@ -28,6 +28,7 @@ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; +import java.io.Serializable; import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -44,8 +45,11 @@ * @todo This class should be changed so map attributes are reflected in a more * generic way like arch attributes. */ -public final class MapArchObject { +public final class MapArchObject implements Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + // tags which appear in the map header private static final String TAG_START_TEXT = "msg"; @@ -57,7 +61,7 @@ /** * Map size. * @fixme this is redundant with {@link DefaultMapModel}. - */ + m */ @NotNull private Size2D mapSize = new Size2D(1, 1); /** Default enter coordinates (usage not recommended). */ Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-08-28 22:05:59 UTC (rev 307) @@ -3,6 +3,7 @@ import daieditor.arch.ArchObject; import java.awt.Point; import java.util.Iterator; +import java.io.Serializable; import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; @@ -18,7 +19,7 @@ * And there is no rollback. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface MapModel extends Iterable<MapSquare>, net.sf.gridarta.map.MapModel { +public interface MapModel extends Iterable<MapSquare>, net.sf.gridarta.map.MapModel, Serializable { /** {@inheritDoc} */ Iterator<MapSquare> iterator(); Modified: trunk/src/app/net/sf/gridarta/Size2D.java =================================================================== --- trunk/src/app/net/sf/gridarta/Size2D.java 2006-08-28 13:56:44 UTC (rev 306) +++ trunk/src/app/net/sf/gridarta/Size2D.java 2006-08-28 22:05:59 UTC (rev 307) @@ -20,11 +20,16 @@ package net.sf.gridarta; +import java.io.Serializable; + /** * The class Size2D represents a 2d rectangular area. */ -public final class Size2D { +public final class Size2D implements Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** * The width of the area. * It is always greater than zero. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 13:56:52
|
Revision: 306 Author: christianhujer Date: 2006-08-28 06:56:44 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=306&view=rev Log Message: ----------- Fixed build errors that occur with the latest versions of saxon. Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-08-28 13:56:13 UTC (rev 305) +++ trunk/build.xml 2006-08-28 13:56:44 UTC (rev 306) @@ -36,7 +36,10 @@ <property name="svn.tag.targetUrl" value="${svn.baseUrl}/tags/${project.version.major}.${project.version.minor}.${project.version.patch}" /> <property name="svn.tag.message" value="Creating release tag for version ${project.version.major}.${project.version.minor}.${project.version.patch}" /> - <taskdef name="megaxslt" classpath="lib/megaxslt.jar" classname="com.hujer.ant.tasks.megaxslt.MegaXsltTask" /> + <path id="xsltpath"> + <fileset dir="lib" includes="**/*.jar" /> + </path> + <taskdef name="megaxslt" classpathref="xsltpath" classname="com.hujer.ant.tasks.megaxslt.MegaXsltTask" /> <taskdef name="rgzip" classpath="lib/megaxslt.jar" classname="com.hujer.ant.tasks.rgzip.RGZipTask" /> <taskdef name="pack200" classpath="lib/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" /> <taskdef name="freshmeat" classpath="lib/antmeat.jar" classname="de.frewert.ant.freshmeat.Announcement"> @@ -157,6 +160,7 @@ validatesource="true" validatedest="true" ending="xhtml" + transformerFactoryImplementationClassName="net.sf.saxon.TransformerFactoryImpl" > <xmlcatalog refid="commonDTDs" /> <transformation stylesheet="src/doc/transform.xslt" /> @@ -170,6 +174,7 @@ validatedest="false" ending="html" converttocanonical="true" + transformerFactoryImplementationClassName="net.sf.saxon.TransformerFactoryImpl" > <xmlcatalog refid="commonDTDs" /> <transformation stylesheet="src/doc/xhtml2html.xslt" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 13:56:19
|
Revision: 305 Author: christianhujer Date: 2006-08-28 06:56:13 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=305&view=rev Log Message: ----------- Fixed typo. Modified Paths: -------------- trunk/src/doc/history.xhtml Modified: trunk/src/doc/history.xhtml =================================================================== --- trunk/src/doc/history.xhtml 2006-08-28 13:16:38 UTC (rev 304) +++ trunk/src/doc/history.xhtml 2006-08-28 13:56:13 UTC (rev 305) @@ -40,7 +40,7 @@ <h2>2000</h2> <p> In 2000, Pasi Keränen published <a href="http://www.gamedev.net/hosted/javanerd/gridder.asp">Gridder</a>, a simple level editor for 2D games. - Based on Gridder, Michael Toennis created CFJavaEditor, a map editor for the popular MMORPG <a href="http://crossfire.real-time.com/">CrossFire</a>, which soon replaced the original cfeditor application for editing maps for CrossFire. + Based on Gridder, Michael Toennis created CFJavaEditor, a map editor for the popular MMORPG <a href="http://crossfire.real-time.com/">CrossFire</a>, which soon replaced the original crossedit application for editing maps for CrossFire. </p> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 13:16:45
|
Revision: 304 Author: christianhujer Date: 2006-08-28 06:16:38 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=304&view=rev Log Message: ----------- Added 2 new rules to codeStyle. Modified Paths: -------------- trunk/src/doc/dev/codeStyle.xhtml Modified: trunk/src/doc/dev/codeStyle.xhtml =================================================================== --- trunk/src/doc/dev/codeStyle.xhtml 2006-08-28 13:16:27 UTC (rev 303) +++ trunk/src/doc/dev/codeStyle.xhtml 2006-08-28 13:16:38 UTC (rev 304) @@ -24,6 +24,8 @@ <li>Imports are sorted alphabetically by package, within a package alphabetically by class.</li> <li>The *-form of import is not allowed.</li> <li>Use inline comments rarely. If you have to use inline comments to explain what code does, something is wrong with the code.</li> + <li>Annotate variables and method types with <code>@Nullable</code> resp. <code>@NotNull</code>.</li> + <li>Annotate action methods with <code>@ActionMethod</code>.</li> </ul> <h2>Field Initialization</h2> <p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 13:16:35
|
Revision: 303 Author: christianhujer Date: 2006-08-28 06:16:27 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=303&view=rev Log Message: ----------- Reversed order in history. Modified Paths: -------------- trunk/src/doc/history.xhtml Modified: trunk/src/doc/history.xhtml =================================================================== --- trunk/src/doc/history.xhtml 2006-08-28 13:16:16 UTC (rev 302) +++ trunk/src/doc/history.xhtml 2006-08-28 13:16:27 UTC (rev 303) @@ -8,34 +8,39 @@ </head> <body> <p> - This document describes the history of the Gridarta project. + This document describes the history of the Gridarta project (newest to oldest). </p> + <h2>2006</h2> <p> - In 2000, Pasi Keränen published <a href="http://www.gamedev.net/hosted/javanerd/gridder.asp">Gridder</a>, a simple level editor for 2D games. - Based on Gridder, Michael Toennis created CFJavaEditor, a map editor for the popular MMORPG <a href="http://crossfire.real-time.com/">CrossFire</a>, which soon replaced the original cfeditor application for editing maps for CrossFire. + In 2006, Christian Hujer, Daniel Viegas (Daimonin) and Andreas Kirschbaum (CrossFire) decided that it would be a good idea to reunite the + development effort of these two editors. + They created "Gridarta" as a project for merging the two editors CFJavaEditor and DaimoninEditor into a single one. </p> <p> - In 2001, Andreas Vogl started maintaining CFJavaEditor, adding a lot of features. + The name "Gridarta" was chosen as a combination of the words "grid" and "art". + It's an imitation of the original "Gridder" name. + It's reminiscence of "Siddharta" is a nice coincidence. </p> + <h2>2005</h2> <p> - In 2002, Michael Toennis created <a href="http://www.daimonin.net/">Daimonin</a> as an independent branch of CrossFire out of ISO-CrossFire, the version of CrossFire with isometric graphics. - For Daimonin, CFJavaEditor became DaimoninEditor. + In 2005, Christian Hujer started lead maintenance of DaimoninEditor, adding numeruous features. </p> + <h2>2002</h2> <p> Since 2002, CFJavaEditor and DaimoninEditor were projects developed independently of each other. </p> <p> - In 2005, Christian Hujer started lead maintenance of DaimoninEditor, adding numeruous features. + In 2002, Michael Toennis created <a href="http://www.daimonin.net/">Daimonin</a> as an independent branch of CrossFire out of ISO-CrossFire, the version of CrossFire with isometric graphics. + For Daimonin, CFJavaEditor became DaimoninEditor. </p> + <h2>2001</h2> <p> - In 2006, Christian Hujer, Daniel Viegas (Daimonin) and Andreas Kirschbaum (CrossFire) decided that it would be a good idea to reunite the - development effort of these two editors. - They created "Gridarta" as a project for merging the two editors CFJavaEditor and DaimoninEditor into a single one. + In 2001, Andreas Vogl started maintaining CFJavaEditor, adding a lot of features. </p> + <h2>2000</h2> <p> - The name "Gridarta" was chosen as a combination of the words "grid" and "art". - It's an imitation of the original "Gridder" name. - It's reminiscence of "Siddharta" is a nice coincidence. + In 2000, Pasi Keränen published <a href="http://www.gamedev.net/hosted/javanerd/gridder.asp">Gridder</a>, a simple level editor for 2D games. + Based on Gridder, Michael Toennis created CFJavaEditor, a map editor for the popular MMORPG <a href="http://crossfire.real-time.com/">CrossFire</a>, which soon replaced the original cfeditor application for editing maps for CrossFire. </p> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 13:16:28
|
Revision: 302 Author: christianhujer Date: 2006-08-28 06:16:16 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=302&view=rev Log Message: ----------- Improved robots.txt to explicitely allow access for robots. Modified Paths: -------------- trunk/src/doc/robots.txt Modified: trunk/src/doc/robots.txt =================================================================== --- trunk/src/doc/robots.txt 2006-08-28 12:52:40 UTC (rev 301) +++ trunk/src/doc/robots.txt 2006-08-28 13:16:16 UTC (rev 302) @@ -2,3 +2,6 @@ Disallow: http://validator.w3.org/check?uri=referer Disallow: http://jigsaw.w3.org/css-validator/check/referer Disallow: /dev/changelog + +User-Agent: * +Disallow: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 12:52:48
|
Revision: 301 Author: christianhujer Date: 2006-08-28 05:52:40 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=301&view=rev Log Message: ----------- Minor refactoring of loading maps (unfinnished). Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CPickmapPanel.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-08-28 12:52:09 UTC (rev 300) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-08-28 12:52:40 UTC (rev 301) @@ -1218,20 +1218,16 @@ final List<ArchObject> objects = mapFileDecoder.decodeMapFile(file, mapDir.getAbsolutePath()); // parse mapfile final MapArchObject maparch = mapFileDecoder.getMapArch(); // get map arch // go to ArchObjectParser and add the default arch list information to them - if (!collectTempList(objects, file)) { // get face names, face id, etc. - return null; // What's this return here? - } - final List<ArchObject> sortedObjects = ArchObjectParser.sortTempList(objects); // sort the list (put multiparts at the end) - final MapControl lastOpenedMap = newLevel(sortedObjects, maparch, view); // init the map + final MapControl newMap = newLevel(objects, maparch, view); // init the map // finally, show the map and refresh toolbars - lastOpenedMap.setMapFile(file); - lastOpenedMap.setActiveEditType(tileEdit); // map is loaded with current view settings + newMap.setMapFile(file); + newMap.setActiveEditType(tileEdit); // map is loaded with current view settings if (view) { refreshMenusAndToolbars(); addRecent(currentMap.getMapArch().getMapNameWithoutMusic(), file.toString()); } - return lastOpenedMap; + return newMap; } catch (final FileNotFoundException e) { ACTION_FACTORY.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); return null; @@ -1279,7 +1275,7 @@ * browse first through the default arch list and attach map arches to it * then browse through the face list and try to find the pictures */ - boolean collectTempList(final List<ArchObject> objects, final File file) { + void collectTempList(final List<ArchObject> objects, final File file) { final StringBuilder noarch = new StringBuilder(); int noarchcount = 0; final List<ArchObject> tailList = new ArrayList<ArchObject>(); @@ -1310,7 +1306,6 @@ if (noarchcount > 0) { ACTION_FACTORY.showMessageDialog(mainView, "collectTemplistAutodelete", file.getName(), noarchcount, noarch); } - return true; } /** Invoked when user wants to save the current level. */ Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 12:52:09 UTC (rev 300) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 12:52:40 UTC (rev 301) @@ -25,6 +25,7 @@ package daieditor; import daieditor.arch.ArchObject; +import daieditor.arch.ArchObjectParser; import daieditor.map.MapArchObject; import java.io.BufferedReader; import java.io.File; @@ -63,7 +64,7 @@ /** * Loading a Daimonin map from the given mapfile. - * This method returns a list of arches, connected with the temp pointers. + * This method returns a list of arches. * @param file mapfile * @param mapDir map directory * @return first <code>ArchObject</code> in the list @@ -93,6 +94,8 @@ while ((thisLine = myInput.readLine()) != null) { readArch(myInput, thisLine); // all these are map arches } + CMainControl.getInstance().collectTempList(objects, file); + ArchObjectParser.sortTempList(objects); return objects; // return first arch of the list } finally { objects = null; Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-08-28 12:52:09 UTC (rev 300) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-08-28 12:52:40 UTC (rev 301) @@ -146,11 +146,7 @@ final CMapViewBasic bmapview; // go to ArchObjectParser and add the default arch list information to them - if (!mainControl.collectTempList(objects, mapFile)) { // get face names, face id, etc. - return false; - } - final List<ArchObject> sortedObjects = ArchObjectParser.sortTempList(objects); // sort the list (put multiparts at the end) - bmapview = newPickmap(sortedObjects, maparch, mapFile, index); // init the map + bmapview = newPickmap(objects, maparch, mapFile, index); // init the map // looks like it worked, so we add a panel and display this pickmap if (bmapview != null) { Modified: trunk/daimonin/src/daieditor/arch/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-08-28 12:52:09 UTC (rev 300) +++ trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-08-28 12:52:40 UTC (rev 301) @@ -584,12 +584,11 @@ * Sort the temp list of arches, placing all multiparts at the end. * This is neccessary to assure multiparts are always on top. * @param objects list of objects - * @return the same list sorted (for convenience) * @note This method assumes that all pieces of one multipart are listed in * a row, which is okay as long as the loader puts it that way. * @note The returned list is the same list, not a new list. */ - public static List<ArchObject> sortTempList(final List<ArchObject> objects) { + public static void sortTempList(final List<ArchObject> objects) { final Comparator<ArchObject> sorter = new Comparator<ArchObject>() { public int compare(final ArchObject o1, final ArchObject o2) { final boolean b1 = o1.isMulti(); @@ -598,7 +597,6 @@ } }; sort(objects, sorter); - return objects; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 12:52:17
|
Revision: 300 Author: christianhujer Date: 2006-08-28 05:52:09 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=300&view=rev Log Message: ----------- Cosmetic maintainability improvements. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObject.java Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-28 12:04:11 UTC (rev 299) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-28 12:52:09 UTC (rev 300) @@ -41,6 +41,7 @@ import javax.swing.ImageIcon; import javax.swing.JList; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * The <code>ArchObject</code> class handles the Daimonin arch objects. @@ -82,7 +83,7 @@ * The archText with the differences from the default arch. * @note Every line in the archText must end on '\n', including the last line. */ - private StringBuffer archText; + @NotNull private StringBuffer archText; /** * The msgText. @@ -90,7 +91,7 @@ * @note If the value is <code>null</code>, the arch has no message text, * if the value exists but is empty, the arch has an empty message text (unconfirmed). */ - private StringBuffer msgText; + @Nullable private StringBuffer msgText; /** The default arch. */ private ArchObject defaultArch; @@ -908,7 +909,7 @@ * @param archText text to set as arch text */ public void setArchText(final String archText) { - this.archText.delete(0, this.archText.length()); + resetArchText(); this.archText.append(archText); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 12:04:18
|
Revision: 299 Author: christianhujer Date: 2006-08-28 05:04:11 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=299&view=rev Log Message: ----------- Removed unreachable if-branch. Modified Paths: -------------- trunk/daimonin/src/daieditor/CPickmapPanel.java Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-08-28 11:45:27 UTC (rev 298) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-08-28 12:04:11 UTC (rev 299) @@ -145,17 +145,12 @@ final MapArchObject maparch = decoder.getMapArch(); final CMapViewBasic bmapview; - if (objects == null) { - // The map is totally empty - bmapview = newPickmap(objects, maparch, mapFile, index); // init the map - } else { - // go to ArchObjectParser and add the default arch list information to them - if (!mainControl.collectTempList(objects, mapFile)) { // get face names, face id, etc. - return false; - } - final List<ArchObject> sortedObjects = ArchObjectParser.sortTempList(objects); // sort the list (put multiparts at the end) - bmapview = newPickmap(sortedObjects, maparch, mapFile, index); // init the map + // go to ArchObjectParser and add the default arch list information to them + if (!mainControl.collectTempList(objects, mapFile)) { // get face names, face id, etc. + return false; } + final List<ArchObject> sortedObjects = ArchObjectParser.sortTempList(objects); // sort the list (put multiparts at the end) + bmapview = newPickmap(sortedObjects, maparch, mapFile, index); // init the map // looks like it worked, so we add a panel and display this pickmap if (bmapview != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 11:45:33
|
Revision: 298 Author: christianhujer Date: 2006-08-28 04:45:27 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=298&view=rev Log Message: ----------- Maps are no longer auto-extended to their objects. Maparch size is obligatory. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:39:01 UTC (rev 297) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:45:27 UTC (rev 298) @@ -47,7 +47,6 @@ */ public final class CMapFileDecode { - private int maxxlen, maxylen; /** ArchObjects that are read from the map. */ private List<ArchObject> objects; @@ -72,8 +71,6 @@ @NotNull public synchronized List<ArchObject> decodeMapFile(@NotNull final File file, final String mapDir) throws FileNotFoundException, IOException { final BufferedReader myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CMainControl.MAP_ENCODING)); try { - maxxlen = 0; - maxylen = 0; objects = new ArrayList<ArchObject>(); //firstArch = null; @@ -96,10 +93,6 @@ while ((thisLine = myInput.readLine()) != null) { readArch(myInput, thisLine); // all these are map arches } - // finally... here we go - // last action: if the map is bigger than the specified size in - // the maparch, we set the true size: the maxxlen/maxylen counters. - maparch.ensureMapSize(maxxlen + 1, maxylen + 1); return objects; // return first arch of the list } finally { objects = null; @@ -164,17 +157,9 @@ arch.addMsgText(""); msgflag = true; } else if (thisLine.startsWith("x ")) { - final int temp = Integer.parseInt(thisLine.substring(2)); - if (temp > maxxlen) { - maxxlen = temp; - } - arch.setMapX(temp); + arch.setMapX(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("y ")) { - final int temp = Integer.parseInt(thisLine.substring(2)); - if (temp > maxylen) { - maxylen = temp; - } - arch.setMapY(temp); + arch.setMapY(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("type ")) { // Arches in maps can override their default arch's type arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-08-28 11:39:01 UTC (rev 297) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-08-28 11:45:27 UTC (rev 298) @@ -192,15 +192,6 @@ this.mapSize = mapSize; } - /** - * Ensure that the map size is at least the given size. - * @param width the new minimum map width - * @param height the new minimum map height - */ - public void ensureMapSize(final int width, final int height) { - mapSize = new Size2D(Math.max(mapSize.getWidth(), width), Math.max(mapSize.getHeight(), height)); - } - @NotNull public Size2D getMapSize() { return mapSize; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 11:39:10
|
Revision: 297 Author: christianhujer Date: 2006-08-28 04:39:01 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=297&view=rev Log Message: ----------- Decreased memory consumption of CMapFileDecode. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:37:40 UTC (rev 296) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:39:01 UTC (rev 297) @@ -96,16 +96,15 @@ while ((thisLine = myInput.readLine()) != null) { readArch(myInput, thisLine); // all these are map arches } + // finally... here we go + // last action: if the map is bigger than the specified size in + // the maparch, we set the true size: the maxxlen/maxylen counters. + maparch.ensureMapSize(maxxlen + 1, maxylen + 1); + return objects; // return first arch of the list } finally { + objects = null; myInput.close(); } - - // finally... here we go - // last action: if the map is bigger than the specified size in - // the maparch, we set the true size: the maxxlen/maxylen counters. - maparch.ensureMapSize(maxxlen + 1, maxylen + 1); - - return objects; // return first arch of the list } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 11:37:46
|
Revision: 296 Author: christianhujer Date: 2006-08-28 04:37:40 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=296&view=rev Log Message: ----------- Fixed bug with loading objects inside containers which was introduced with revision 294. ViewCVS Links: ------------- http://svn.sourceforge.net/gridarta/?rev=294&view=rev Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:28:13 UTC (rev 295) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:37:40 UTC (rev 296) @@ -49,6 +49,9 @@ private int maxxlen, maxylen; + /** ArchObjects that are read from the map. */ + private List<ArchObject> objects; + /** Contains the map arch (see MapArchObject class). */ private MapArchObject maparch; @@ -68,10 +71,12 @@ */ @NotNull public synchronized List<ArchObject> decodeMapFile(@NotNull final File file, final String mapDir) throws FileNotFoundException, IOException { final BufferedReader myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CMainControl.MAP_ENCODING)); - final List<ArchObject> objects = new ArrayList<ArchObject>(); try { maxxlen = 0; maxylen = 0; + objects = new ArrayList<ArchObject>(); + //firstArch = null; + // first of all we read the map arch (if that fails we throw an exception) maparch = new MapArchObject(); final String fname; @@ -89,10 +94,7 @@ // Outer loop: reads "arch ...", inner loop reads until end of arch String thisLine; while ((thisLine = myInput.readLine()) != null) { - final ArchObject arch = readArch(myInput, thisLine); // all these are map arches - if (arch != null) { - objects.add(arch); - } + readArch(myInput, thisLine); // all these are map arches } } finally { myInput.close(); @@ -154,6 +156,7 @@ //System.err.println("GO INVENTORY2: "+arch+" - "+thisLine); } else if (thisLine.startsWith("end")) { // chain this to temp list + objects.add(arch); archflag = false; // System.err.println("LEAVE!: "+arch+" - "+thisLine); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-28 11:28:27
|
Revision: 295 Author: christianhujer Date: 2006-08-28 04:28:13 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=295&view=rev Log Message: ----------- Minor refactoring of map loading. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-08-27 21:57:34 UTC (rev 294) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-08-28 11:28:13 UTC (rev 295) @@ -242,9 +242,6 @@ /** The current top map we are working with */ private MapControl currentMap; - /** The last opened map. Used for hidden working */ - private MapControl lastOpenedMap; - /** The current main directory. */ private File currentDir; @@ -1188,76 +1185,64 @@ * something went wrong */ boolean openFile(final File file) { - return openFile(file, true); + return openFile(file, true) != null; } /** * Load a mapfile. * @param file mapfile * @param view only create a view if this is true - * @return true if the file was new, false if the file already was open or - * something went wrong + * @return MapControl of loaded file or <code>null</code> if the file couldn't be opened */ - public boolean openFile(final File file, final boolean view) { - lastOpenedMap = null; + public MapControl openFile(final File file, final boolean view) { + // First look whether the file isn't already open. + // If so, return the previously loaded map. try { final File can = file.getCanonicalFile(); for (final MapControl level : levels) { final File levelFile = level.getMapFile(); if (levelFile != null && can.equals(levelFile.getCanonicalFile())) { - lastOpenedMap = level; if (view) { level.createView(); setCurrentLevel(level); setCurrentLevelView(level.getMapViewFrame()); } - return false; + return level; } } } catch (final IOException e) { logger.log(Level.WARNING, "canonIOE", e); } - final List<ArchObject> objects; - final MapArchObject maparch; - try { - objects = mapFileDecoder.decodeMapFile(file, mapDir.getAbsolutePath()); // parse mapfile - maparch = mapFileDecoder.getMapArch(); // get map arch + final List<ArchObject> objects = mapFileDecoder.decodeMapFile(file, mapDir.getAbsolutePath()); // parse mapfile + final MapArchObject maparch = mapFileDecoder.getMapArch(); // get map arch + // go to ArchObjectParser and add the default arch list information to them + if (!collectTempList(objects, file)) { // get face names, face id, etc. + return null; // What's this return here? + } + final List<ArchObject> sortedObjects = ArchObjectParser.sortTempList(objects); // sort the list (put multiparts at the end) + final MapControl lastOpenedMap = newLevel(sortedObjects, maparch, view); // init the map + + // finally, show the map and refresh toolbars + lastOpenedMap.setMapFile(file); + lastOpenedMap.setActiveEditType(tileEdit); // map is loaded with current view settings + if (view) { + refreshMenusAndToolbars(); + addRecent(currentMap.getMapArch().getMapNameWithoutMusic(), file.toString()); + } + return lastOpenedMap; } catch (final FileNotFoundException e) { ACTION_FACTORY.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); - return false; + return null; } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); - return false; + return null; } catch (final OutOfMemoryError ignore) { // out of memory!! - display error ACTION_FACTORY.showMessageDialog(mainView, "mapOutOfMemory"); - return false; + return null; } - - // ok, we have it all!! - - if (objects == null) { - // The map is totally empty - lastOpenedMap = newLevel(objects, maparch, view); // init the map - } else { - // go to ArchObjectParser and add the default arch list information to them - if (!collectTempList(objects, file)) { // get face names, face id, etc. - return false; // What's this return here? - } - final List<ArchObject> sortedObjects = ArchObjectParser.sortTempList(objects); // sort the list (put multiparts at the end) - lastOpenedMap = newLevel(sortedObjects, maparch, view); // init the map - } - - // finally, show the map and refresh toolbars - lastOpenedMap.setMapFile(file); - lastOpenedMap.setActiveEditType(tileEdit); // map is loaded with current view settings - if (view) { - refreshMenusAndToolbars(); - addRecent(currentMap.getMapArch().getMapNameWithoutMusic(), file.toString()); - } - return true; } /** @@ -2179,14 +2164,6 @@ return mapCursorControl; } - /** - * Returns the last opened map. Used for hidden working - * @return the last opened map. Used for hidden working - */ - public MapControl getLastOpenedMap() { - return lastOpenedMap; - } - public static String getBuildNumberAsString() { try { return getBundle("build").getString("build.number"); Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 21:57:34 UTC (rev 294) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-28 11:28:13 UTC (rev 295) @@ -35,6 +35,7 @@ import java.util.ArrayList; import java.util.List; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * This class handles the reading of a mapfile and parsing the data @@ -65,7 +66,7 @@ * @param mapDir map directory * @return first <code>ArchObject</code> in the list */ - public synchronized List<ArchObject> decodeMapFile(final File file, final String mapDir) throws FileNotFoundException, IOException { + @NotNull public synchronized List<ArchObject> decodeMapFile(@NotNull final File file, final String mapDir) throws FileNotFoundException, IOException { final BufferedReader myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CMainControl.MAP_ENCODING)); final List<ArchObject> objects = new ArrayList<ArchObject>(); try { Modified: trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-08-27 21:57:34 UTC (rev 294) +++ trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-08-28 11:28:13 UTC (rev 295) @@ -174,8 +174,7 @@ } final CMainControl mainControl = CMainControl.getInstance(); // Open file without view - mainControl.openFile(file, false); - final MapControl mapControl = mainControl.getLastOpenedMap(); + final MapControl mapControl = mainControl.openFile(file, false); if (mapControl == null) { return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 21:57:38
|
Revision: 294 Author: christianhujer Date: 2006-08-27 14:57:34 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=294&view=rev Log Message: ----------- Refactored objects that are read to be local. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 21:54:38 UTC (rev 293) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 21:57:34 UTC (rev 294) @@ -48,9 +48,6 @@ private int maxxlen, maxylen; - /** ArchObjects that are read from the map. */ - private List<ArchObject> objects; - /** Contains the map arch (see MapArchObject class). */ private MapArchObject maparch; @@ -69,14 +66,11 @@ * @return first <code>ArchObject</code> in the list */ public synchronized List<ArchObject> decodeMapFile(final File file, final String mapDir) throws FileNotFoundException, IOException { - final BufferedReader myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CMainControl.MAP_ENCODING)); + final List<ArchObject> objects = new ArrayList<ArchObject>(); try { maxxlen = 0; maxylen = 0; - objects = new ArrayList<ArchObject>(); - //firstArch = null; - // first of all we read the map arch (if that fails we throw an exception) maparch = new MapArchObject(); final String fname; @@ -94,7 +88,10 @@ // Outer loop: reads "arch ...", inner loop reads until end of arch String thisLine; while ((thisLine = myInput.readLine()) != null) { - readArch(myInput, thisLine); // all these are map arches + final ArchObject arch = readArch(myInput, thisLine); // all these are map arches + if (arch != null) { + objects.add(arch); + } } } finally { myInput.close(); @@ -156,7 +153,6 @@ //System.err.println("GO INVENTORY2: "+arch+" - "+thisLine); } else if (thisLine.startsWith("end")) { // chain this to temp list - objects.add(arch); archflag = false; // System.err.println("LEAVE!: "+arch+" - "+thisLine); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 21:54:44
|
Revision: 293 Author: christianhujer Date: 2006-08-27 14:54:38 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=293&view=rev Log Message: ----------- Removed unused method parameter. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 16:59:55 UTC (rev 292) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 21:54:38 UTC (rev 293) @@ -94,7 +94,7 @@ // Outer loop: reads "arch ...", inner loop reads until end of arch String thisLine; while ((thisLine = myInput.readLine()) != null) { - readArch(myInput, thisLine, null); // all these are map arches + readArch(myInput, thisLine); // all these are map arches } } finally { myInput.close(); @@ -117,12 +117,11 @@ * included in CF!) * @param myInput input filestream * @param thisLine first line of text, belonging to this new arch - * @param container container arch that contains this new arch - if any * @return the new parsed <code>ArchObject</code> * @throws IOException when an I/O-error occured during file reading * @fixme I'm too long, make me shorter - what about a HashMap<String,Integer> and switch/case? */ - @Nullable private ArchObject readArch(final BufferedReader myInput, String thisLine, final ArchObject container) throws IOException { + @Nullable private ArchObject readArch(final BufferedReader myInput, String thisLine) throws IOException { boolean msgflag = false; boolean archflag = false; ArchObject arch = null; @@ -153,7 +152,7 @@ // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit //System.err.println("GO INVENTORY: "+arch+" - "+thisLine); - arch.addLast(readArch(myInput, thisLine, arch)); + arch.addLast(readArch(myInput, thisLine)); //System.err.println("GO INVENTORY2: "+arch+" - "+thisLine); } else if (thisLine.startsWith("end")) { // chain this to temp list This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 17:00:06
|
Revision: 292 Author: christianhujer Date: 2006-08-27 09:59:55 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=292&view=rev Log Message: ----------- Removed todo (that's done). Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 16:58:48 UTC (rev 291) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 16:59:55 UTC (rev 292) @@ -43,7 +43,6 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo unify CMapFileDecode and CMapFileEncode about the usage of CMainControl */ public final class CMapFileDecode { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 16:58:53
|
Revision: 291 Author: christianhujer Date: 2006-08-27 09:58:48 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=291&view=rev Log Message: ----------- Cosmetic: Declared a var final. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileEncode.java Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-08-27 16:48:27 UTC (rev 290) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-08-27 16:58:48 UTC (rev 291) @@ -76,7 +76,7 @@ final Point pos = new Point(); for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (ArchObject node : mapModel.getMapSquare(pos)) { + for (final ArchObject node : mapModel.getMapSquare(pos)) { // only non muli suckers if (node.getMapMultiHead() == null && node.getMultiRefCount() == 0) { writeMapArch(node, false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 16:48:32
|
Revision: 290 Author: christianhujer Date: 2006-08-27 09:48:27 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=290&view=rev Log Message: ----------- Substantial improvement of ArchObjectContainer: * Made it fail fast in case of bogus usage (throwing IllegalArgumentException). * Documented nullability. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 16:33:12 UTC (rev 289) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 16:48:27 UTC (rev 290) @@ -39,27 +39,36 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo: In case of MapSquares, this class is most likely bogus regarding multipart objects. This needs to be fixed. */ +@SuppressWarnings({"ClassReferencesSubclass"}) public abstract class ArchObjectContainer implements Iterable<ArchObject> { /** * The contents of this container. * @note the order of this container is bottom to top. */ - private List<ArchObject> contents = new ArrayList<ArchObject>(); + @NotNull private List<ArchObject> contents; /** Iterable implementation for recursice traversal. */ - private Iterable<ArchObject> recursive; + @NotNull private Iterable<ArchObject> recursive; /** Iterable implementation for reverse traversal. */ - private Iterable<ArchObject> reverse; + @NotNull private Iterable<ArchObject> reverse; /** Create a new ArchObjectContainer. */ protected ArchObjectContainer() { - initIterables(); + initData(); } - /** Initialize recursive and reverse. */ - private void initIterables() { + /** + * Initialize the fields. + * This is needed because there are two ways of object construction, + * <ul> + * <li>regular object construction via constructor invocation and</li> + * <li>cloning of objects via {@link #clone()}.</li> + * </ul> + */ + private void initData() { + contents = new ArrayList<ArchObject>(); recursive = new Iterable<ArchObject>() { /** {@inheritDoc} */ public Iterator<ArchObject> iterator() { @@ -69,7 +78,7 @@ reverse = new Iterable<ArchObject>() { /** {@inheritDoc} */ public Iterator<ArchObject> iterator() { - return new ReverseIterator(); + return new ReverseIterator<ArchObject>(contents); } }; // Iterable<ArchObject> reverse } @@ -79,7 +88,7 @@ * The Iterator returned does not recurse, it only containes objects on the first level. * The Iterator returned is transparent, that means modifying the iterator's collection actually modifies the unterlying ArchObjectContainer. */ - public final Iterator<ArchObject> iterator() { + @NotNull public final Iterator<ArchObject> iterator() { return contents.iterator(); } @@ -88,7 +97,7 @@ * Invoke this method if you want to iterate over the arches in reverse order. * @return reverse representation */ - public final Iterable<ArchObject> reverse() { + @NotNull public final Iterable<ArchObject> reverse() { return reverse; } @@ -97,7 +106,7 @@ * Invoke this method if you want to iterate over the contained arches recursively. * @return recursive representation */ - public final Iterable<ArchObject> recursive() { + @NotNull public final Iterable<ArchObject> recursive() { return recursive; } @@ -111,28 +120,30 @@ /** * Return the first object contained in this container. - * You should not invoke this method to iterate over ArchObjects, such invocation is regarded deprecated. - * @return first object contained + * @return first object contained or <code>null</code> if {@link #isEmpty()} returns <code>true</code> */ - public final ArchObject getFirst() { + @Nullable public final ArchObject getFirst() { return contents.get(0); } /** * Return the last object contained in this container. * You should not invoke this method to iterate over ArchObjects, such invocation is regarded deprecated. - * @return last object contained + * @return last object contained or <code>null</code> if {@link #isEmpty()} returns <code>true</code> */ - public final ArchObject getLast() { + @Nullable public final ArchObject getLast() { return contents.get(contents.size() - 1); } /** * Remove an ArchObject from this container. * @param arch ArchObject to remove + * @throws IllegalArgumentException if <var>arch</var> isn't in this container */ - final void remove(final ArchObject arch) { - contents.remove(arch); + final void remove(@NotNull final ArchObject arch) { + if (!contents.remove(arch)) { + throw new IllegalArgumentException(arch + " wasn't inside container " + this); + } arch.setContainer(null); squareChanged(); } @@ -149,11 +160,14 @@ /** * Move an item to top. * @param arch item to move to top + * @throws IllegalArgumentException if <var>arch</var> isn't in this container */ - public final void moveTop(final ArchObject arch) { + public final void moveTop(@NotNull final ArchObject arch) { final int oldIndex = contents.indexOf(arch); if (oldIndex != contents.size() - 1) { - contents.remove(arch); + if (!contents.remove(arch)) { + throw new IllegalArgumentException(arch + " wasn't inside container " + this); + } contents.add(arch); squareChanged(); } @@ -162,11 +176,14 @@ /** * Move an item up. * @param arch item to move up + * @throws IllegalArgumentException if <var>arch</var> isn't in this container */ - public final void moveUp(final ArchObject arch) { + public final void moveUp(@NotNull final ArchObject arch) { final int oldIndex = contents.indexOf(arch); if (oldIndex < contents.size() - 1) { - contents.remove(arch); + if (!contents.remove(arch)) { + throw new IllegalArgumentException(arch + " wasn't inside container " + this); + } contents.add(oldIndex + 1, arch); squareChanged(); } @@ -175,11 +192,14 @@ /** * Move an item down. * @param arch item to move down + * @throws IllegalArgumentException if <var>arch</var> isn't in this container */ - public final void moveDown(final ArchObject arch) { + public final void moveDown(@NotNull final ArchObject arch) { final int oldIndex = contents.indexOf(arch); if (oldIndex > 0) { - contents.remove(arch); + if (!contents.remove(arch)) { + throw new IllegalArgumentException(arch + " wasn't inside container " + this); + } contents.add(oldIndex - 1, arch); squareChanged(); } @@ -188,11 +208,14 @@ /** * Move an item to bottom. * @param arch item to move to bottom + * @throws IllegalArgumentException if <var>arch</var> isn't in this container */ - public final void moveBottom(final ArchObject arch) { + public final void moveBottom(@NotNull final ArchObject arch) { final int oldIndex = contents.indexOf(arch); if (oldIndex != 0) { - contents.remove(arch); + if (!contents.remove(arch)) { + throw new IllegalArgumentException(arch + " wasn't inside container " + this); + } contents.add(0, arch); squareChanged(); } @@ -213,8 +236,12 @@ /** * Add the given ArchObject at the end of this Container. * @param arch the free yet unlinked <code>ArchObject</code> to be placed in the inventory + * @throws IllegalArgumentException if <var>arch</var> already is inside another container */ - public void addLast(final ArchObject arch) { + public void addLast(@NotNull final ArchObject arch) { + if (arch.isInContainer()) { + throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + } contents.add(arch); arch.setContainer(this); squareChanged(); @@ -223,8 +250,12 @@ /** * Add the given ArchObject at the end of this Container. * @param arch the free yet unlinked <code>ArchObject</code> to be placed in the inventory + * @throws IllegalArgumentException if <var>arch</var> already is inside another container */ - public void addFirst(final ArchObject arch) { + public void addFirst(@NotNull final ArchObject arch) { + if (arch.isInContainer()) { + throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + } contents.add(0, arch); arch.setContainer(this); squareChanged(); @@ -234,9 +265,16 @@ * Add an ArchObject after another. * @param prev previous anchor * @param arch ArchObject to insert + * @throws IllegalArgumentException if <var>arch</var> already is inside another container or <var>prev</var> isn't inside this container */ - public void insertAfter(final ArchObject prev, final ArchObject arch) { + public void insertAfter(@NotNull final ArchObject prev, @NotNull final ArchObject arch) { + if (arch.isInContainer()) { + throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + } final int insertIndex = contents.indexOf(prev); + if (insertIndex == -1) { + throw new IllegalArgumentException("Can't insert " + arch + " after " + prev + " because that isn't inside " + this); + } contents.add(insertIndex, arch); arch.setContainer(this); squareChanged(); @@ -246,9 +284,16 @@ * Add an ArchObject before another. * @param arch ArchObject to insert * @param next next anchor + * @throws IllegalArgumentException if <var>arch</var> already is inside another container or <var>prev</var> isn't inside this container */ - public void insertBefore(final ArchObject arch, final ArchObject next) { + public void insertBefore(@NotNull final ArchObject arch, @NotNull final ArchObject next) { + if (arch.isInContainer()) { + throw new IllegalArgumentException("Can't add " + arch + " to " + this + " because it's already inside " + arch.getContainer()); + } final int insertIndex = contents.indexOf(next); + if (insertIndex == -1) { + throw new IllegalArgumentException("Can't insert " + arch + " before " + next + " because that isn't inside " + this); + } contents.add(insertIndex + 1, arch); arch.setContainer(this); squareChanged(); @@ -258,24 +303,25 @@ * Replace an ArchObject with another one. * @param oldArch old ArchObject to be replaced * @param newArch new ArchObject that replaces oldArch + * @throws IllegalArgumentException if <var>oldArch</var> isn't in this container */ - public void replace(final ArchObject oldArch, final ArchObject newArch) { + public void replace(@NotNull final ArchObject oldArch, @NotNull final ArchObject newArch) { final int insertIndex = contents.indexOf(oldArch); + if (insertIndex == -1) { + throw new IllegalArgumentException(oldArch + " wasn't inside container " + this); + } contents.remove(oldArch); - contents.add(newArch); oldArch.setContainer(null); + contents.add(insertIndex, newArch); newArch.setContainer(this); squareChanged(); - newArch.setMapX(getMapX()); // ??? - newArch.setMapY(getMapY()); // ??? - squareChanged(); } /** * Get the MapSquare of this ArchObjectContainer. * @return MapSquare of this ArchObjectContainer or <code>null</code> if this ArchObjectContainer is not (yet?) connected to a map (a {@link MapSquare} would return itself) */ - public abstract MapSquare getMapSquare(); + @Nullable public abstract MapSquare getMapSquare(); /** * Tell the model that this MapSquare has changed. @@ -289,10 +335,10 @@ } /** {@inheritDoc} */ - @Override protected ArchObjectContainer clone() throws CloneNotSupportedException { + @NotNull @Override protected ArchObjectContainer clone() throws CloneNotSupportedException { try { final ArchObjectContainer clone = (ArchObjectContainer) super.clone(); - clone.initIterables(); + clone.initData(); return clone; } catch (final CloneNotSupportedException e) { assert false; @@ -300,21 +346,38 @@ } } - /** ArchObjectIterator for iterating over this container in reverse order. */ - private class ReverseIterator implements Iterator<ArchObject> { - private ListIterator<ArchObject> delegate = contents.listIterator(contents.size()); + /** + * An iterator for iterating over a list in reverse order. + * @todo move this class to JAPI + */ + private static class ReverseIterator<T> implements Iterator<T> { + /** The iterator used for delegation. */ + @NotNull private final ListIterator<T> delegate; + + /** + * Create a reverse iterator. + * @param list to iterate over in reverse order + */ + public ReverseIterator(final List<T> list) { + delegate = list.listIterator(list.size()); + } + + /** {@inheritDoc} */ public boolean hasNext() { return delegate.hasPrevious(); } - public ArchObject next() { + /** {@inheritDoc} */ + @NotNull public T next() { return delegate.previous(); } + /** {@inheritDoc} */ public void remove() { delegate.remove(); } + } // class ReverseIterator } // interface ArchObjectContainer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 16:33:18
|
Revision: 289 Author: christianhujer Date: 2006-08-27 09:33:12 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=289&view=rev Log Message: ----------- Removed redundant setting of the container while reading arches from the map. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 16:18:00 UTC (rev 288) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 16:33:12 UTC (rev 289) @@ -139,9 +139,6 @@ arch.setDirection(-1); // our arch! it has a name! arch.setArchName(thisLine.substring("arch ".length()).trim()); - - // ok, we have setup our arch, now check for inventory - arch.setContainer(container); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 16:18:05
|
Revision: 288 Author: christianhujer Date: 2006-08-27 09:18:00 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=288&view=rev Log Message: ----------- Fixed broken remove(). Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 15:57:43 UTC (rev 287) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 16:18:00 UTC (rev 288) @@ -30,11 +30,11 @@ import org.jetbrains.annotations.NotNull; /** - * Base class for classes that match contain ArchObjects as children. + * Base class for classes that contain ArchObjects as children. * The interface serves 2 main purposes: * <ul> * <li>{@link ArchObject} extends this class for containing other arches, like bag contents or attached events.</li> - * <li>{@link daieditor.map.MapSquare} extends this class to list the tiles on a MapSquare.</li> + * <li>{@link MapSquare} extends this class to list the tiles on a MapSquare.</li> * </ul> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo: In case of MapSquares, this class is most likely bogus regarding multipart objects. This needs to be fixed. @@ -115,7 +115,7 @@ * @return first object contained */ public final ArchObject getFirst() { - return contents.get(contents.size() - 1); + return contents.get(0); } /** @@ -124,7 +124,7 @@ * @return last object contained */ public final ArchObject getLast() { - return contents.get(0); + return contents.get(contents.size() - 1); } /** @@ -132,6 +132,7 @@ * @param arch ArchObject to remove */ final void remove(final ArchObject arch) { + contents.remove(arch); arch.setContainer(null); squareChanged(); } @@ -272,7 +273,7 @@ /** * Get the MapSquare of this ArchObjectContainer. - * @return MapSquare of this ArchObjectContainer or <code>null</code> if this ArchObjectContainer is not (yet?) connected to a map + * @return MapSquare of this ArchObjectContainer or <code>null</code> if this ArchObjectContainer is not (yet?) connected to a map (a {@link MapSquare} would return itself) */ public abstract MapSquare getMapSquare(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 15:57:51
|
Revision: 287 Author: christianhujer Date: 2006-08-27 08:57:43 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=287&view=rev Log Message: ----------- File when saving a map must not be null. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-08-27 15:53:13 UTC (rev 286) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-08-27 15:57:43 UTC (rev 287) @@ -60,6 +60,7 @@ import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * The main controller of the level editor. Basically the main application. @@ -1020,7 +1021,7 @@ * @param file File to save to * @param mapModel MapModel to save */ - public void encodeMapFile(final File file, final MapModel mapModel) { + public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { mapFileEncoder.encodeMapFile(file, mapModel); } @@ -1134,6 +1135,7 @@ if (returnVal == JFileChooser.APPROVE_OPTION) { hasChangedDir = true; // user has chosen an active dir final File file = fileChooser.getSelectedFile(); + assert file != null; level.saveAs(file); level.setMapFileName(file.getName()); // window title and file name //level.setMapName(file.getName()); // map name (internal) Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-08-27 15:53:13 UTC (rev 286) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-08-27 15:57:43 UTC (rev 287) @@ -41,6 +41,7 @@ import java.util.Iterator; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; /** * The <code>CMapFileEncode</code> @@ -69,15 +70,10 @@ * @param file mapfile * @param mapModel the MapModel to encode */ - public void encodeMapFile(File file, final MapModel mapModel) { + public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { final MapArchObject map = mapModel.getMapArchObject(); try { - if (file == null) { - // if the file doesn't yet exist, we create it in the map-folder - file = new File(mainControl.getMapDefaultFolder(), map.getFileName()); - } - fname = file.getAbsolutePath(); fileWriter = new FileWriter(file); bufferedWriter = new BufferedWriter(fileWriter); Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-08-27 15:53:13 UTC (rev 286) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-08-27 15:57:43 UTC (rev 287) @@ -39,6 +39,7 @@ import java.util.Iterator; import java.util.List; import net.sf.gridarta.Size2D; +import org.jetbrains.annotations.NotNull; /** * The <code>MapControl</code> @@ -571,6 +572,7 @@ } else { CMainStatusbar.getInstance().setText("Saving map '" + getMapFileName() + "'..."); } + assert mapFile != null; mainControl.encodeMapFile(mapFile, mapModel); mapModel.resetLevelChangedFlag(); mapView.changedFlagNotify(); @@ -580,7 +582,7 @@ * Save the file with the given file name. * @param file the file to be saved to */ - public void saveAs(final File file) { + public void saveAs(@NotNull final File file) { CMainStatusbar.getInstance().setText("Saving the map to a file..."); mainControl.encodeMapFile(file, mapModel); mapModel.resetLevelChangedFlag(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 15:53:19
|
Revision: 286 Author: christianhujer Date: 2006-08-27 08:53:13 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=286&view=rev Log Message: ----------- Fixed broken addFirst() / addLast(). Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 15:17:23 UTC (rev 285) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 15:53:13 UTC (rev 286) @@ -214,7 +214,7 @@ * @param arch the free yet unlinked <code>ArchObject</code> to be placed in the inventory */ public void addLast(final ArchObject arch) { - contents.add(0, arch); + contents.add(arch); arch.setContainer(this); squareChanged(); } @@ -224,7 +224,7 @@ * @param arch the free yet unlinked <code>ArchObject</code> to be placed in the inventory */ public void addFirst(final ArchObject arch) { - contents.add(arch); + contents.add(0, arch); arch.setContainer(this); squareChanged(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 15:17:30
|
Revision: 285 Author: christianhujer Date: 2006-08-27 08:17:23 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=285&view=rev Log Message: ----------- Removed More handling from CMapFileDecode in daieditor. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 14:34:53 UTC (rev 284) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 15:17:23 UTC (rev 285) @@ -68,7 +68,6 @@ * @param file mapfile * @param mapDir map directory * @return first <code>ArchObject</code> in the list - * @todo remove mainControl param and replace with mapDir param */ public synchronized List<ArchObject> decodeMapFile(final File file, final String mapDir) throws FileNotFoundException, IOException { @@ -123,103 +122,80 @@ * @return the new parsed <code>ArchObject</code> * @throws IOException when an I/O-error occured during file reading * @fixme I'm too long, make me shorter - what about a HashMap<String,Integer> and switch/case? - * @todo Ask Michtoen whether More in maps is supported / used at all */ @Nullable private ArchObject readArch(final BufferedReader myInput, String thisLine, final ArchObject container) throws IOException { - // thisLine intentionally is not final, it will be reassigned during the loop - //String thisLine; + boolean msgflag = false; + boolean archflag = false; + ArchObject arch = null; + do { + thisLine = thisLine.trim(); - try { - boolean msgflag = false; - boolean archmore = false; - boolean archflag = false; - ArchObject arch = null; - do { - thisLine = thisLine.trim(); + if (!archflag) { + if (thisLine.startsWith("arch ")) { + archflag = true; // from now on we are inside an arch + arch = new ArchObject(); // create a new instance - if (!archflag) { - if (thisLine.startsWith("More")) { // FIXME: Really "More" not "More " (space)? - // All arches started with "More" are ignored. We load only - // the heads and expand them according to the defaults. - archmore = true; - } else if (thisLine.startsWith("arch ")) { - archflag = true; // from now on we are inside an arch - if (!archmore) { - arch = new ArchObject(); // create a new instance + // if this is still -1 in the post parse, we have no direction command loaded + arch.setDirection(-1); + // our arch! it has a name! + arch.setArchName(thisLine.substring("arch ".length()).trim()); - // if this is still -1 in the post parse, we have no direction command loaded - arch.setDirection(-1); - // our arch! it has a name! - arch.setArchName(thisLine.substring("arch ".length()).trim()); + // ok, we have setup our arch, now check for inventory + arch.setContainer(container); + } - // ok, we have setup our arch, now check for inventory - arch.setContainer(container); - } + } else { + // here were are inside of an arch object (but not "More")... + if (msgflag) { + if (thisLine.startsWith("endmsg")) { + msgflag = false; + } else { + arch.addMsgText(thisLine + '\n'); } + } else if (thisLine.startsWith("arch ")) { + // ok, we had a full arch... don't care here about map or object + // now we test for a new arch - thats stuf in inventory + // or the end... thats the end of this shit + //System.err.println("GO INVENTORY: "+arch+" - "+thisLine); + arch.addLast(readArch(myInput, thisLine, arch)); + //System.err.println("GO INVENTORY2: "+arch+" - "+thisLine); + } else if (thisLine.startsWith("end")) { + // chain this to temp list + objects.add(arch); + archflag = false; - } else if (!archmore) { - // here were are inside of an arch object (but not "More")... - if (msgflag) { - if (thisLine.startsWith("endmsg")) { - msgflag = false; - } else { - arch.addMsgText(thisLine + '\n'); - } - } else if (thisLine.startsWith("arch ")) { - // ok, we had a full arch... don't care here about map or object - // now we test for a new arch - thats stuf in inventory - // or the end... thats the end of this shit - //System.err.println("GO INVENTORY: "+arch+" - "+thisLine); - arch.addLast(readArch(myInput, thisLine, arch)); - //System.err.println("GO INVENTORY2: "+arch+" - "+thisLine); - } else if (thisLine.startsWith("end")) { - // chain this to temp list - objects.add(arch); - archflag = false; - archmore = false; - - // System.err.println("LEAVE!: "+arch+" - "+thisLine); - return arch; - } else if (thisLine.startsWith("msg")) { - arch.addMsgText(""); - msgflag = true; - } else if (thisLine.startsWith("x ")) { - final int temp = Integer.parseInt(thisLine.substring(2)); - if (temp > maxxlen) { - maxxlen = temp; - } - arch.setMapX(temp); - } else if (thisLine.startsWith("y ")) { - final int temp = Integer.parseInt(thisLine.substring(2)); - if (temp > maxylen) { - maxylen = temp; - } - arch.setMapY(temp); - } else if (thisLine.startsWith("type ")) { - // Arches in maps can override their default arch's type - arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); - // don't load it into the archtext! (why?) - } else if (thisLine.startsWith("direction ")) { - arch.setDirection(Integer.parseInt(thisLine.substring(10))); - arch.addArchText(thisLine + '\n'); - } else if (thisLine.startsWith("face ")) { - arch.setFaceRealName(thisLine.substring("face ".length()).trim()); - arch.addArchText(thisLine + '\n'); - } else { - arch.addArchText(thisLine + '\n'); + // System.err.println("LEAVE!: "+arch+" - "+thisLine); + return arch; + } else if (thisLine.startsWith("msg")) { + arch.addMsgText(""); + msgflag = true; + } else if (thisLine.startsWith("x ")) { + final int temp = Integer.parseInt(thisLine.substring(2)); + if (temp > maxxlen) { + maxxlen = temp; } - } else { - // We are in a multipart tail arch ("more"), so we skip it: - if (thisLine.startsWith("end")) { - archflag = false; - archmore = false; + arch.setMapX(temp); + } else if (thisLine.startsWith("y ")) { + final int temp = Integer.parseInt(thisLine.substring(2)); + if (temp > maxylen) { + maxylen = temp; } + arch.setMapY(temp); + } else if (thisLine.startsWith("type ")) { + // Arches in maps can override their default arch's type + arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); + // don't load it into the archtext! (why?) + } else if (thisLine.startsWith("direction ")) { + arch.setDirection(Integer.parseInt(thisLine.substring(10))); + arch.addArchText(thisLine + '\n'); + } else if (thisLine.startsWith("face ")) { + arch.setFaceRealName(thisLine.substring("face ".length()).trim()); + arch.addArchText(thisLine + '\n'); + } else { + arch.addArchText(thisLine + '\n'); } - } while ((thisLine = myInput.readLine()) != null); - } catch (final IOException e) { - System.err.println("Read Error while trying to load map: " + maparch.getFileName()); - throw e; // we simply pass this exception to the calling function - } + } + } while ((thisLine = myInput.readLine()) != null); return null; // this happens when the file end is reached } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |