package sample.game.builder; import java.util.ArrayList; import library.core.model.CoreModel; import library.core.object.CoreObjectFactory; import library.core.system.CoreImageData; import library.core.view.CoreView; import sample.game.controller.TitleAiController; import sample.game.main.AiGameTitle; import sample.game.model.titleAi.NumberButton; import sample.game.model.titleAi.NumberButton.TitleAiButtonType; import sample.game.model.titleAi.TitleAiNextButton; public class TitleAiBuilder { private CoreObjectFactory objectFactory; public TitleAiBuilder(CoreObjectFactory objectFactory){ this.objectFactory=objectFactory; } public TitleAiController build(AiGameTitle palent,int boatNum,int ministerNum,int wolfNum, int cabbageNum,int cattleNum){ TitleAiController controller=new TitleAiController(palent); //ロゴの表示 CoreModel logo=new CoreModel(new CoreImageData("image/title/titlelogo.png"), 640, 96, 1024, 144); objectFactory.create(logo, new CoreView(logo, 2)); //背景表示 CoreModel back=new CoreModel(new CoreImageData("image/back/title.png"), 640, 369, 1280, 720); objectFactory.create(back, new CoreView(back, 0)); controller.setBackScreen(back); //フェイド用のマスク CoreModel fadeMask=new CoreModel(new CoreImageData("image/game/screen/fadeMask.png"), 640, 360, 1280, 720); fadeMask.setShowView(false); fadeMask.setAlpha(0); objectFactory.create(fadeMask, new CoreView(fadeMask, 20)); controller.setFadeMask(fadeMask); back=new CoreModel(new CoreImageData("image/back/title.png"), -640, 369, 1280, 720); objectFactory.create(back, new CoreView(back, 0)); controller.setBackScreen2(back); //左下の説明欄 CoreModel titleExample=new CoreModel(new CoreImageData("image/title/ai/ui/titleExample.png"), 350, 645, 528, 96); objectFactory.create(titleExample, new CoreView(titleExample, 2)); //右下のゲームスタートボタン TitleAiNextButton button=new TitleAiNextButton(controller, new CoreImageData("image/title/ai/ui/ai_start.png"), 920, 645, 532, 156); objectFactory.create(button, new CoreView(button, 2)); controller.setNextButton(button); //ボタンの背景の表示 CoreModel buttonBack=new CoreModel(new CoreImageData("image/title/ai/ui/ai_title.png"), 640, 370, 1024, 416); objectFactory.create(buttonBack, new CoreView(buttonBack, 1)); ///////////////////////////////////////////////////// //ボタン ///////////////////////////////////////////////////// ArrayList<NumberButton> numberButtons=new ArrayList<NumberButton>(); //ボート CoreImageData off=new CoreImageData("image/title/ai/ui/ai_boat2_off.png"); CoreImageData on=new CoreImageData("image/title/ai/ui/ai_boat2_on.png"); NumberButton numbutton=new NumberButton(2==boatNum?true:false,controller,TitleAiButtonType.boat, 2, on, off, 190, 262, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_boat3_off.png"); on=new CoreImageData("image/title/ai/ui/ai_boat3_on.png"); numbutton=new NumberButton(3==boatNum?true:false,controller,TitleAiButtonType.boat, 3, on, off, 190, 384, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_boat4_off.png"); on=new CoreImageData("image/title/ai/ui/ai_boat4_on.png"); numbutton=new NumberButton(4==boatNum?true:false,controller,TitleAiButtonType.boat, 4, on, off, 190, 517, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); ///////////////////////////////////////////////////////////////////////////////// //みなみ off=new CoreImageData("image/title/ai/ui/ai_minami1_off.png"); on=new CoreImageData("image/title/ai/ui/ai_minami1_on.png"); numbutton=new NumberButton(1==ministerNum?true:false,controller,TitleAiButtonType.minister, 1, on, off, 416, 262, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_minami2_off.png"); on=new CoreImageData("image/title/ai/ui/ai_minami2_on.png"); numbutton=new NumberButton(2==ministerNum?true:false,controller,TitleAiButtonType.minister, 2, on, off, 416, 384, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_minami3_off.png"); on=new CoreImageData("image/title/ai/ui/ai_minami3_on.png"); numbutton=new NumberButton(3==ministerNum?true:false,controller,TitleAiButtonType.minister, 3, on, off, 416, 517, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); ////////////////////////////////////////////////////////////////////////////////// //りんご off=new CoreImageData("image/title/ai/ui/ai_apple1_off.png"); on=new CoreImageData("image/title/ai/ui/ai_apple1_on.png"); numbutton=new NumberButton(1==cabbageNum?true:false,controller,TitleAiButtonType.cabbage, 1, on, off, 640, 262, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_apple2_off.png"); on=new CoreImageData("image/title/ai/ui/ai_apple2_on.png"); numbutton=new NumberButton(2==cabbageNum?true:false,controller,TitleAiButtonType.cabbage, 2, on, off, 640, 384, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_apple3_off.png"); on=new CoreImageData("image/title/ai/ui/ai_apple3_on.png"); numbutton=new NumberButton(3==cabbageNum?true:false,controller,TitleAiButtonType.cabbage, 3, on, off, 640, 517, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); ////////////////////////////////////////////////////////////////////////////////// //なんぼう off=new CoreImageData("image/title/ai/ui/ai_nanbou1_off.png"); on=new CoreImageData("image/title/ai/ui/ai_nanbou1_on.png"); numbutton=new NumberButton(1==cattleNum?true:false,controller,TitleAiButtonType.cattle, 1, on, off, 865, 262, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_nanbou2_off.png"); on=new CoreImageData("image/title/ai/ui/ai_nanbou2_on.png"); numbutton=new NumberButton(2==cattleNum?true:false,controller,TitleAiButtonType.cattle, 2, on, off, 865, 384, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_nanbou3_off.png"); on=new CoreImageData("image/title/ai/ui/ai_nanbou3_on.png"); numbutton=new NumberButton(3==cattleNum?true:false,controller,TitleAiButtonType.cattle, 3, on, off, 865, 517, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); ////////////////////////////////////////////////////////////////////////////////// //へび off=new CoreImageData("image/title/ai/ui/ai_snake1_off.png"); on=new CoreImageData("image/title/ai/ui/ai_snake1_on.png"); numbutton=new NumberButton(1==wolfNum?true:false,controller,TitleAiButtonType.wolf, 1, on, off, 1088, 262, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_snake2_off.png"); on=new CoreImageData("image/title/ai/ui/ai_snake2_on.png"); numbutton=new NumberButton(2==wolfNum?true:false,controller,TitleAiButtonType.wolf, 2, on, off, 1088, 384, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); off=new CoreImageData("image/title/ai/ui/ai_snake3_off.png"); on=new CoreImageData("image/title/ai/ui/ai_snake3_on.png"); numbutton=new NumberButton(3==wolfNum?true:false,controller,TitleAiButtonType.wolf, 3, on, off, 1088, 517, 96, 96); objectFactory.create(numbutton, new CoreView(numbutton, 4)); numberButtons.add(numbutton); controller.setNumberButtons(numberButtons); controller.checkInitProduction(); return controller; } }