• R/O
  • SSH
  • HTTPS

simyukkuri: 提交


Commit MetaInfo

修订版263 (tree)
时间2015-09-11 10:17:00
作者mimisuke

Log Message

The fineness of FoodMaker can be specified.

更改概述

差异

--- branches/test/GarbageChute.java (revision 262)
+++ branches/test/GarbageChute.java (revision 263)
@@ -97,8 +97,8 @@
9797 return cost;
9898 }
9999
100- public GarbageChute(int initX, int initY, Direction initDir) {
101- super(initX, initY, ObjEX.Direction.BACK);
100+ public GarbageChute(int initX, int initY) {
101+ super(initX, initY);
102102 objType = Type.PLATFORM;
103103 }
104104 }
\ No newline at end of file
--- branches/test/MachinePress.java (revision 262)
+++ branches/test/MachinePress.java (revision 263)
@@ -104,8 +104,8 @@
104104 return cost;
105105 }
106106
107- public MachinePress(int initX, int initY, Direction initDir) {
108- super(initX, initY, initDir);
107+ public MachinePress(int initX, int initY) {
108+ super(initX, initY);
109109 objType = Type.FIX_OBJECT;
110110 }
111111 }
\ No newline at end of file
--- branches/test/OrangePool.java (revision 262)
+++ branches/test/OrangePool.java (revision 263)
@@ -25,6 +25,9 @@
2525 private static final int images_num = 1; // このクラスの総使用画像数
2626 private static Image[] images = new Image[images_num];
2727
28+ public static enum PoolType {
29+ NORMAL, RESCUE
30+ }
2831 private boolean rescue;
2932 private static int[] value = {500, 10000};
3033 private static int[] cost = {10, 200};
@@ -114,15 +117,15 @@
114117 return cost[type];
115118 }
116119
117- public OrangePool(int initX, int initY, Direction initDir) {
118- super(initX, initY, ObjEX.Direction.BACK);
119- switch (initDir) { // 方向データを仮利用
120- case BACK:
120+ public OrangePool(int initX, int initY, PoolType poolType) {
121+ super(initX, initY);
122+ switch (poolType) {
123+ case NORMAL:
121124 default:
122125 rescue = false;
123126 type = 0;
124127 break;
125- case THISSIDE:
128+ case RESCUE:
126129 rescue = true;
127130 type = 1;
128131 break;
--- branches/test/inits/SimYukkuri_en.json (revision 262)
+++ branches/test/inits/SimYukkuri_en.json (revision 263)
@@ -16,7 +16,7 @@
1616 { "name": "Breeding pool", "submenu": ["Low-priced", "Full-bodied", "Growth-promoting", "Professional-use"] },
1717 { "name": "Garbage chute" },
1818 { "name": "Machine press" },
19- { "name": "Food maker" },
19+ { "name": "Food maker", "submenu": ["Fine", "Medium", "Rough"] },
2020 { "name": "Orange pool", "submenu": ["For drink", "For rescue use"] },
2121 { "name": "Product chute" } ],
2222 [ { "name": "Pause" },
--- branches/test/inits/SimYukkuri_jp.json (revision 262)
+++ branches/test/inits/SimYukkuri_jp.json (revision 263)
@@ -16,7 +16,7 @@
1616 { "name": "養殖プール", "submenu": ["廉価品", "こくまろ", "高速成長薬添加", "プロ用"] },
1717 { "name": "ダストシュート" },
1818 { "name": "プレス機" },
19- { "name": "フードメーカー" },
19+ { "name": "フードメーカー", "submenu": ["細かい", "中くらい", "粗い"] },
2020 { "name": "オレンジプール", "submenu": ["清涼飲料水", "救命用"] },
2121 { "name": "製品投入口" } ],
2222 [ { "name": "一時停止" },
--- branches/test/FoodMaker.java (revision 262)
+++ branches/test/FoodMaker.java (revision 263)
@@ -26,6 +26,11 @@
2626 private static final int images_num = 6; // このクラスの総使用画像数
2727 private static int AnimeImagesNum[] = {6};// アニメごとに何枚使うか
2828 private static Image[] images = new Image[images_num];
29+
30+ public static enum MakerType {
31+ FINE, MEDIUM, ROUGH
32+ }
33+ private MakerType type;
2934
3035 protected boolean processReady = true;
3136 private static int value = 30000;
@@ -92,10 +97,25 @@
9297 Food.type foodType = null;
9398 int foodNum = 1;
9499 int foodAmount = -1;
95- if (o.objType == Obj.Type.YUKKURI) {
100+ if (o.objType == Type.YUKKURI) {
96101 Body b = (Body)o;
97- if (!b.isCrashed() && !b.isBaby()) {
98- return;
102+ if (!b.isCrashed()) {
103+ switch (type) {
104+ case FINE:
105+ return;
106+ case MEDIUM:
107+ if (!b.isBaby()) {
108+ return;
109+ }
110+ break;
111+ case ROUGH:
112+ if (!b.isBaby() && !b.isChild()) {
113+ return;
114+ }
115+ break;
116+ default:
117+ break;
118+ }
99119 }
100120 if (shitCount != 0) {
101121 foodType = Food.type.BITTER;
@@ -214,8 +234,9 @@
214234 return cost;
215235 }
216236
217- public FoodMaker(int initX, int initY, Direction initDir) {
218- super(initX, initY, ObjEX.Direction.BACK);
237+ public FoodMaker(int initX, int initY, MakerType makerType) {
238+ super(initX, initY);
219239 objType = Type.PLATFORM;
240+ type = makerType;
220241 }
221242 }
\ No newline at end of file
--- branches/test/ObjEX.java (revision 262)
+++ branches/test/ObjEX.java (revision 263)
@@ -20,16 +20,6 @@
2020 static final long serialVersionUID = 1L;
2121
2222 protected Image[] images;
23-
24- public static enum Direction {
25- BACK, THISSIDE, RIGHT, LEFT
26- };
27-
28- public static final int PLATFORM_BACK = 0;
29- public static final int PLATFORM_THISSIDE = 1;
30- public static final int PLATFORM_RIGHT = 2;
31- public static final int PLATFORM_LEFT = 3;
32- protected Direction direction;
3323 protected static int size;
3424
3525 // getSize() for static style
@@ -36,10 +26,6 @@
3626 public static int getSizeS() {
3727 return size;
3828 }
39-
40- public Direction getDirection() {
41- return direction;
42- }
4329
4430 public String getMessage() {
4531 return null;
@@ -128,11 +114,10 @@
128114 return Event.DONOTHING;
129115 }
130116
131- public ObjEX(int initX, int initY, Direction initDir) {
117+ public ObjEX(int initX, int initY) {
132118 objType = Type.PLATFORM;
133119 x = initX;
134120 y = initY;
135121 z = 0;
136- direction = initDir;
137122 }
138123 }
\ No newline at end of file
--- branches/test/BreedingPool.java (revision 262)
+++ branches/test/BreedingPool.java (revision 263)
@@ -26,6 +26,9 @@
2626 private static final int images_num = 1; // このクラスの総使用画像数
2727 private static Image[] images = new Image[images_num];
2828
29+ public static enum PoolType {
30+ NONE, HIGHDENSITY, RAPIDGROWTH, BOTH
31+ }
2932 private boolean highDensity;
3033 private boolean rapidGrowth;
3134 private static int[] value = {1000, 4000, 4000, 10000};
@@ -96,28 +99,28 @@
9699 return cost[type];
97100 }
98101
99- public BreedingPool(int initX, int initY, Direction initDir) {
100- super(initX, initY, ObjEX.Direction.BACK);
101- switch (initDir) { // 方向データを仮利用
102- case BACK:
102+ public BreedingPool(int initX, int initY, PoolType poolType) {
103+ super(initX, initY);
104+ switch (poolType) {
105+ case NONE:
103106 default:
104107 highDensity = false;
105108 rapidGrowth = false;
106109 break;
107- case THISSIDE:
110+ case HIGHDENSITY:
108111 highDensity = true;
109112 rapidGrowth = false;
110113 break;
111- case RIGHT:
114+ case RAPIDGROWTH:
112115 highDensity = false;
113116 rapidGrowth = true;
114117 break;
115- case LEFT:
118+ case BOTH:
116119 highDensity = true;
117120 rapidGrowth = true;
118121 break;
119122 }
120123 objType = Type.PLATFORM;
121- type = initDir.ordinal();
124+ type = poolType.ordinal();
122125 }
123126 }
\ No newline at end of file
--- branches/test/ProductChute.java (revision 262)
+++ branches/test/ProductChute.java (revision 263)
@@ -130,8 +130,8 @@
130130 return cost;
131131 }
132132
133- public ProductChute(int initX, int initY, Direction initDir) {
134- super(initX, initY, ObjEX.Direction.BACK);
133+ public ProductChute(int initX, int initY) {
134+ super(initX, initY);
135135 objType = Type.PLATFORM;
136136 }
137137 }
\ No newline at end of file
--- branches/test/Terrarium.java (revision 262)
+++ branches/test/Terrarium.java (revision 263)
@@ -780,35 +780,35 @@
780780
781781 }
782782
783- public void buyObjEx( int addObjEX, int x, int y, ObjEX.Direction dir) {
783+ public void buyObjEx( int addObjEX, int x, int y, Object option) {
784784 ObjEX o;
785785 switch(addObjEX){
786786 case SimYukkuri.BELTCONVEYOR:
787- o = new Beltconveyor(x, y, dir);
787+ o = new Beltconveyor(x, y, (Beltconveyor.Direction)option);
788788 objExList.add(o);
789789 break;
790790 case SimYukkuri.BREEDINGPOOL:
791- o = new BreedingPool(x, y, dir);
791+ o = new BreedingPool(x, y, (BreedingPool.PoolType)option);
792792 objExList.add(o);
793793 break;
794794 case SimYukkuri.GARBAGECHUTE:
795- o = new GarbageChute(x, y, dir);
795+ o = new GarbageChute(x, y);
796796 objExList.add(o);
797797 break;
798798 case SimYukkuri.MACHINEPRESS:
799- o = new MachinePress(x, y, dir);
799+ o = new MachinePress(x, y);
800800 fixedObjExList.add(o);
801801 break;
802802 case SimYukkuri.FOODMAKER:
803- o = new FoodMaker(x, y, dir);
803+ o = new FoodMaker(x, y, (FoodMaker.MakerType)option);
804804 objExList.add(o);
805805 break;
806806 case SimYukkuri.ORANGEPOOL:
807- o = new OrangePool(x, y, dir);
807+ o = new OrangePool(x, y, (OrangePool.PoolType)option);
808808 objExList.add(o);
809809 break;
810810 case SimYukkuri.PRODUCTCHUTE:
811- o = new ProductChute(x, y, dir);
811+ o = new ProductChute(x, y);
812812 objExList.add(o);
813813 break;
814814 default:
--- branches/test/Beltconveyor.java (revision 262)
+++ branches/test/Beltconveyor.java (revision 263)
@@ -26,6 +26,11 @@
2626 private static int AnimeImagesNum[] = {5, 5};// アニメごとに何枚使うか
2727 private static Image[] images = new Image[images_num];
2828
29+ public static enum Direction {
30+ BACK, THISSIDE, RIGHT, LEFT
31+ };
32+ protected Direction direction;
33+
2934 private int beltSpeed;
3035 private static final int value = 2000;
3136 private static final int cost = 1;
@@ -40,7 +45,7 @@
4045
4146 @Override
4247 public Image getImage() {
43- switch (direction) { // 楽にアニメ指定できるようにしたいが後で
48+ switch (direction) {
4449 case BACK:
4550 default:
4651 return images[(int)age / 4 % AnimeImagesNum[0]]; // 4フレームに1回画像更新
@@ -78,7 +83,7 @@
7883 int objY = o.getY();
7984 int objSize = o.getSize();
8085 if (!Terrarium.onBarrier(objX, objY, objSize / 2, objSize / 4)) { // 壁にひっかかっていれば移動させない
81- switch (getDirection()) { // 移動させる方向
86+ switch (direction) { // 移動させる方向
8287 case BACK:
8388 default:
8489 o.setY(objY - beltSpeed);
@@ -122,8 +127,9 @@
122127 }
123128
124129 public Beltconveyor(int initX, int initY, Direction initDir) {
125- super(initX, initY, initDir);
130+ super(initX, initY);
126131 objType = Type.PLATFORM;
127132 beltSpeed = 1;
133+ direction = initDir;
128134 }
129135 }
\ No newline at end of file
--- branches/test/SimYukkuri.java (revision 262)
+++ branches/test/SimYukkuri.java (revision 263)
@@ -43,13 +43,11 @@
4343 static boolean initialized = false;
4444
4545 static final int TOOL = 0, FOOD = 1, CLEAN = 2, ACCESSORY = 3, PICKUP = 4, PANTS = 5, TOILET = 6, BARRIER = 7, TOYS = 8, BELTCONVEYOR = 9, BREEDINGPOOL = 10 ,GARBAGECHUTE = 11, MACHINEPRESS = 12, FOODMAKER = 13, ORANGEPOOL = 14, PRODUCTCHUTE = 15;
46-
4746 static final int PUNISH = 0, HAMMER = 1, VIBRATOR = 2, JUICE = 3, DECOPING = 4;
48- static final int BACK = 0, THISSIDE = 1, RIGHT = 2, LEFT = 3;
4947 static final int NORMAL = 0, BITTER = 1, SELFFEEDER = 2, LEMONPOP = 3, HOT = 4, VIYUGRA = 5, FUNGICIDE = 6;
5048 static final int INDIVIDUAL = 0, ALL = 1;
5149 static final int SET = 0, DEL = 1;
52- static int selectedTool = 0, selectedFood = 0, selectedCleaner = 0, selectedBarrier = 0, selectedBeltconveyor = 0, selectedBreedingPool = 0, selectedOrangePool = 0, selectedGameSpeed = 1;
50+ static int selectedTool = 0, selectedFood = 0, selectedCleaner = 0, selectedBarrier = 0, selectedBeltconveyor = 0, selectedBreedingPool = 0, selectedOrangePool = 0, selectedGameSpeed = 1, selectedFoodMaker = 0;
5351 JLabel title;
5452 JPanel rootPane = new JPanel();
5553 JPanel buttonPane = new JPanel();
@@ -239,7 +237,7 @@
239237 break;
240238 case FOOD:
241239 s2.setSelectedIndex(selectedFood);
242- break;
240+ break;
243241 case CLEAN:
244242 s2.setSelectedIndex(selectedCleaner);
245243 break;
@@ -247,11 +245,17 @@
247245 s2.setSelectedIndex(selectedBarrier);
248246 break;
249247 case BELTCONVEYOR:
248+ s2.setSelectedIndex(selectedBeltconveyor);
249+ break;
250+ case BREEDINGPOOL:
250251 s2.setSelectedIndex(selectedBreedingPool);
251252 break;
252253 case ORANGEPOOL:
253- s2.setSelectedIndex(selectedBreedingPool);
254- break;
254+ s2.setSelectedIndex(selectedOrangePool);
255+ break;
256+ case FOODMAKER:
257+ s2.setSelectedIndex(selectedFoodMaker);
258+ break;
255259 default:
256260 s2.setSelectedIndex(0);
257261 break;
@@ -288,6 +292,23 @@
288292 case CLEAN:
289293 selectedCleaner = s2.getSelectedIndex();
290294 break;
295+ case BARRIER:
296+ selectedBarrier = s2.getSelectedIndex();
297+ break;
298+ case BELTCONVEYOR:
299+ selectedBeltconveyor = s2.getSelectedIndex();
300+ break;
301+ case BREEDINGPOOL:
302+ selectedBreedingPool = s2.getSelectedIndex();
303+ break;
304+ case ORANGEPOOL:
305+ selectedOrangePool = s2.getSelectedIndex();
306+ break;
307+ case FOODMAKER:
308+ selectedFoodMaker = s2.getSelectedIndex();
309+ break;
310+ default:
311+ break;
291312 }
292313 }
293314 else if (e.getSource() == s3) {
@@ -643,20 +664,20 @@
643664 x = Translate.invX(e.getX(), e.getY(), Beltconveyor.getSizeS(), w, h);
644665 y = Translate.invY(e.getX(), e.getY(), Beltconveyor.getSizeS() / 2, w, h);
645666 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
646- ObjEX.Direction dir;
667+ Beltconveyor.Direction dir;
647668 switch (s2.getSelectedIndex()) {
648- case BACK:
669+ case 0:
649670 default:
650- dir = ObjEX.Direction.BACK;
671+ dir = Beltconveyor.Direction.BACK;
651672 break;
652- case THISSIDE:
653- dir = ObjEX.Direction.THISSIDE;
673+ case 1:
674+ dir = Beltconveyor.Direction.THISSIDE;
654675 break;
655- case RIGHT:
656- dir = ObjEX.Direction.RIGHT;
676+ case 2:
677+ dir = Beltconveyor.Direction.RIGHT;
657678 break;
658- case LEFT:
659- dir = ObjEX.Direction.LEFT;
679+ case 3:
680+ dir = Beltconveyor.Direction.LEFT;
660681 break;
661682 }
662683 mypane.terrarium.buyObjEx(BELTCONVEYOR, x, y, dir);
@@ -666,23 +687,23 @@
666687 x = Translate.invX(e.getX(), e.getY(), BreedingPool.getSizeS(), w, h);
667688 y = Translate.invY(e.getX(), e.getY(), BreedingPool.getSizeS() / 2, w, h);
668689 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
669- ObjEX.Direction dir;
690+ BreedingPool.PoolType type;
670691 switch (s2.getSelectedIndex()) {
671- case BACK:
692+ case 0:
672693 default:
673- dir = ObjEX.Direction.BACK;
694+ type = BreedingPool.PoolType.NONE;
674695 break;
675- case THISSIDE:
676- dir = ObjEX.Direction.THISSIDE;
696+ case 1:
697+ type = BreedingPool.PoolType.HIGHDENSITY;
677698 break;
678- case RIGHT:
679- dir = ObjEX.Direction.RIGHT;
699+ case 2:
700+ type = BreedingPool.PoolType.RAPIDGROWTH;
680701 break;
681- case LEFT:
682- dir = ObjEX.Direction.LEFT;
702+ case 3:
703+ type = BreedingPool.PoolType.BOTH;
683704 break;
684705 }
685- mypane.terrarium.buyObjEx(BREEDINGPOOL, x, y, dir);
706+ mypane.terrarium.buyObjEx(BREEDINGPOOL, x, y, type);
686707 }
687708 break;
688709 case GARBAGECHUTE:
@@ -689,7 +710,7 @@
689710 x = Translate.invX(e.getX(), e.getY(), GarbageChute.getSizeS(), w, h);
690711 y = Translate.invY(e.getX(), e.getY(), GarbageChute.getSizeS() / 2, w, h);
691712 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
692- mypane.terrarium.buyObjEx(GARBAGECHUTE, x, y, ObjEX.Direction.BACK);
713+ mypane.terrarium.buyObjEx(GARBAGECHUTE, x, y, null);
693714 }
694715 break;
695716 case MACHINEPRESS:
@@ -696,7 +717,7 @@
696717 x = Translate.invX(e.getX(), e.getY(), MachinePress.getSizeS(), w, h);
697718 y = Translate.invY(e.getX(), e.getY(), MachinePress.getSizeS() / 2, w, h);
698719 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
699- mypane.terrarium.buyObjEx(MACHINEPRESS, x, y, ObjEX.Direction.BACK);
720+ mypane.terrarium.buyObjEx(MACHINEPRESS, x, y, null);
700721 }
701722 break;
702723 case FOODMAKER:
@@ -703,7 +724,20 @@
703724 x = Translate.invX(e.getX(), e.getY(), FoodMaker.getSizeS(), w, h);
704725 y = Translate.invY(e.getX(), e.getY(), FoodMaker.getSizeS() / 2, w, h);
705726 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
706- mypane.terrarium.buyObjEx(FOODMAKER, x, y, ObjEX.Direction.BACK);
727+ FoodMaker.MakerType type;
728+ switch (s2.getSelectedIndex()) {
729+ case 0:
730+ default:
731+ type = FoodMaker.MakerType.FINE;
732+ break;
733+ case 1:
734+ type = FoodMaker.MakerType.MEDIUM;
735+ break;
736+ case 2:
737+ type = FoodMaker.MakerType.ROUGH;
738+ break;
739+ }
740+ mypane.terrarium.buyObjEx(FOODMAKER, x, y, type);
707741 }
708742 break;
709743 case ORANGEPOOL:
@@ -710,23 +744,17 @@
710744 x = Translate.invX(e.getX(), e.getY(), OrangePool.getSizeS(), w, h);
711745 y = Translate.invY(e.getX(), e.getY(), OrangePool.getSizeS() / 2, w, h);
712746 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
713- ObjEX.Direction dir;
747+ OrangePool.PoolType type;
714748 switch (s2.getSelectedIndex()) {
715- case BACK:
749+ case 0:
716750 default:
717- dir = ObjEX.Direction.BACK;
751+ type = OrangePool.PoolType.NORMAL;
718752 break;
719- case THISSIDE:
720- dir = ObjEX.Direction.THISSIDE;
753+ case 1:
754+ type = OrangePool.PoolType.RESCUE;
721755 break;
722- case RIGHT:
723- dir = ObjEX.Direction.BACK;
724- break;
725- case LEFT:
726- dir = ObjEX.Direction.BACK;
727- break;
728756 }
729- mypane.terrarium.buyObjEx(ORANGEPOOL, x, y, dir);
757+ mypane.terrarium.buyObjEx(ORANGEPOOL, x, y, type);
730758 }
731759 break;
732760 case PRODUCTCHUTE:
@@ -733,7 +761,7 @@
733761 x = Translate.invX(e.getX(), e.getY(), ProductChute.getSizeS(), w, h);
734762 y = Translate.invY(e.getX(), e.getY(), ProductChute.getSizeS() / 2, w, h);
735763 if (x >= 0 && x <= Terrarium.MAX_X && y >= 0 && y <= Terrarium.MAX_Y) {
736- mypane.terrarium.buyObjEx(PRODUCTCHUTE, x, y, ObjEX.Direction.BACK);
764+ mypane.terrarium.buyObjEx(PRODUCTCHUTE, x, y, null);
737765 }
738766 break;
739767 case BARRIER:
Show on old repository browser