Exemple #1
0
        // メソッド

        public CharacterSet(int id, Controller controller, CharacterInitializer characterInitializer)
        {
            characterId               = id;
            form                      = null;
            this.controller           = controller;
            this.characterInitializer = characterInitializer;
        }
Exemple #2
0
        public TestCharacterSet(int id, Controller controller, CharacterInitializer characterInitializer) : base(id, controller, characterInitializer)
        {
            // 必須
            characterName = "TestCharacter1";

            // テスト用 コピペしないで
            counter = 0;
            rnd     = new Random();
        }
Exemple #3
0
        //int counter;
        //Random rnd;

        public Character1Set(int id, Controller controller, CharacterInitializer characterInitializer) : base(id, controller, characterInitializer)
        {
            // 必須
            characterName = "アイラ";

            // テスト用 コピペしないで
            //counter = 0;
            //rnd = new Random();
        }
        private int reaction_hold_time = 0;//インターバル50なので、1秒は20。


        public Character1Form(CharacterInitializer characterInitializer)
        {
            InitializeComponent();

            // 最後に呼び出すこと(正確にはInitializeComponentの後に呼び出す)
            // これを呼び出さないと掴んで移動が出来ない
            characterInitializer.initCharaPictureBox(pictureBox2);

            // 右クリックでコンテキストメニューを表示できるようになる
            characterInitializer.addContextMenu(this.contextMenuStrip1);
        }
Exemple #5
0
 public ListsMaker(Controller controller, CharacterInitializer characterInitializer)
 {
     this.mainScreenMgrList          = null;
     this.subScreenMgrList           = null;
     this.characterSetList           = null;
     this.mainScreenMgrIdAndNameList = null;
     this.characterSetIdAndNameList  = null;
     this.characterInitializer       = characterInitializer;
     this.commandList = null;
     this.controller  = controller;
 }
        // コンストラクタ内のCharacterInitializerの記述のみ必要になる
        // それ以外は自由にどうぞ
        public TestCharacter1Form(CharacterInitializer characterInitializer)
        {
            mode         = AnimationMode.DEFAULT;
            animeCounter = 0;
            InitializeComponent();

            // 以下は最後に呼び出すこと(正確にはInitializeComponentの後に呼び出す)

            // 掴んで移動が出来るようになる
            characterInitializer.initCharaPictureBox(pictureBox1);
            // 右クリックでコンテキストメニューを表示できるようになる
            characterInitializer.addContextMenu(this.contextMenuStrip1);
        }
Exemple #7
0
        public Controller()
        {
            defaultCharacterIndex = 1;
            defaultMainScrIndex   = 0;
            runningMainScr        = null;
            runningCharacterSet   = null;
            // キャラクター初期化に使うInitializerを生成
            characterInitializer = new CharacterInitializer(new MouseEventHandler(pictureBox1_MouseDown), new MouseEventHandler(pictureBox1_MouseUp), new MouseEventHandler(pictureBox1_MouseMove), new EventHandler(pictureBox1_MouseCaptureChanged));
            // 必要なもの生成器を生成する
            listsMaker = new ProductListsMaker(this, characterInitializer);

            // メンバ変数の初期化
            mainScreenMgrList          = listsMaker.getMainScreenMgrList();
            subScreenMgrList           = listsMaker.getSubScreenMgrList();
            characterSetList           = listsMaker.getCharacterSetList();
            mainScreenMgrIdAndNameList = listsMaker.getMainScreenMgrIDAndNameList();
            characterSetIdAndNameList  = listsMaker.getCharacterSetIDAndNameList();

            changeCharacter(defaultCharacterIndex);

            InitializeComponent();
        }
        // 本番用ListsMaker

        public ProductListsMaker(Controller controller, CharacterInitializer characterInitializer) : base(controller, characterInitializer)
        {
            // メンバ変数の初期化
            mainScreenMgrList          = new List <MainScreenMgr>();
            subScreenMgrList           = new List <SubScreenMgr>();
            characterSetList           = new List <CharacterSet>();
            mainScreenMgrIdAndNameList = new List <IDAndName>();
            characterSetIdAndNameList  = new List <IDAndName>();
            commandList = new List <Command>();

            // 一時的に確保しておく変数
            MainScreenMgr bufMainScrMgr;
            SubScreenMgr  bufSubScrMgr;
            CharacterSet  bufCharaSet;
            IDAndName     bufIDAndName;
            Command       bufCommand;

            // 全てのSubScreenMgrを生成し、Listに入れる
            bufSubScrMgr = new WeatherScreen(0);
            subScreenMgrList.Add(bufSubScrMgr);
            bufSubScrMgr = new Newsviewer(1);
            subScreenMgrList.Add(bufSubScrMgr);
            bufSubScrMgr = new TwitterViewer(2);
            subScreenMgrList.Add(bufSubScrMgr);
            bufSubScrMgr = new OpenAccess(3);
            subScreenMgrList.Add(bufSubScrMgr);

            // 全てのCommandを生成し、Listに入れる
            bufCommand = new HelpCommand(0, "help", subScreenMgrList);
            commandList.Add(bufCommand);
            bufCommand = new CharacterChangeCommand(1, "characterchange", characterSetList, controller);
            commandList.Add(bufCommand);
            bufCommand = new OpenMScrCommand(2, "openmainscreen", mainScreenMgrList, controller);
            commandList.Add(bufCommand);
            bufCommand = new CloseMScrCommand(3, "closemainscreen", controller);
            commandList.Add(bufCommand);
            bufCommand = new OpenCommand(4, "open");
            commandList.Add(bufCommand);
            bufCommand = new ExitCommand(5, "exit", controller);
            commandList.Add(bufCommand);


            characterInitializer.setCommandList(commandList);

            // 全てのCharacterSetを生成し、Listに入れる
            // IDと名前も同時に記録しておく
            // 1個目 コンストラクタ
            bufCharaSet = new TestCharacterSet(0, controller, characterInitializer);
            characterSetList.Add(bufCharaSet);
            // 2個目 IDと名前
            bufIDAndName.id   = bufCharaSet.getId();
            bufIDAndName.name = bufCharaSet.getName();
            characterSetIdAndNameList.Add(bufIDAndName);

            // IDと名前も同時に記録しておく
            // 1個目 コンストラクタ
            bufCharaSet = new Character1Set(1, controller, characterInitializer);
            characterSetList.Add(bufCharaSet);
            // 2個目 IDと名前
            bufIDAndName.id   = bufCharaSet.getId();
            bufIDAndName.name = bufCharaSet.getName();
            characterSetIdAndNameList.Add(bufIDAndName);


            // 全てのMainScreenMgrを生成し、Listに入れる
            // IDと名前も同時に記録しておく

            // 1個目 コンストラクタ
            bufMainScrMgr = new ConsoleScreen(0, subScreenMgrList, controller, commandList);
            mainScreenMgrList.Add(bufMainScrMgr);
            // 1個目 IDと名前
            bufIDAndName.id   = bufMainScrMgr.getId();
            bufIDAndName.name = bufMainScrMgr.getName();
            mainScreenMgrIdAndNameList.Add(bufIDAndName);
        }