コード例 #1
0
        public Character GetCharacter(char key)
        {
            Character character = null;

            if (characters.ContainsKey(key))
            {
                character = characters[key];
            }
            else
            {
                switch (key)
                {
                case 'A':
                    character = new CharacterA();
                    break;

                case 'B':
                    character = new CharacterB();
                    break;

                case 'Z':
                    character = new CharacterZ();
                    break;
                }

                characters.Add(key, character);
            }
            return(character);
        }
コード例 #2
0
        public Character GetCharacter(char key)
        {
            Character character = null;

            if(characters.ContainsKey(key))
            {
                character = characters[key];
            }
            else
            {
                switch(key)
                {
                    case 'A':
                        character = new CharacterA();
                        break;
                    case 'B':
                        character = new CharacterB();
                        break;
                    case 'Z':
                        character = new CharacterZ();
                        break;
                }

                characters.Add(key, character);
            }
            return character;
        }