Ejemplo n.º 1
0
        protected override void Invoke_02(string command, params string[] arguments)
        {
            int c = 0;

            if (command == ScenarioWords.COMMAND_Chara)
            {
                int chara = int.Parse(arguments[c++]);

                if (chara < 0 || Enum.GetValues(typeof(Chara_t)).Cast <int>().Max() < chara)
                {
                    throw new DDError("Bad chara: " + chara);
                }

                this.Chara = (Chara_t)chara;
            }
            else if (command == ScenarioWords.COMMAND_Mode)
            {
                int mode = int.Parse(arguments[c++]);

                if (mode < 0 || Enum.GetValues(typeof(Mode_t)).Cast <int>().Max() < mode)
                {
                    throw new DDError("Bad mode: " + mode);
                }

                this.Mode = (Mode_t)mode;
            }
            else
            {
                throw new DDError();
            }
        }
Ejemplo n.º 2
0
        protected override void Deserialize_02(string[] lines)
        {
            int c = 0;

            this.Chara = (Chara_t)int.Parse(lines[c++]);
            this.Mode  = (Mode_t)int.Parse(lines[c++]);
        }