示例#1
0
        private static Hero MakeCustomHero()
        {
            var  builder   = new HeroBuilder();
            bool isFlyHero = false;

            do
            {
                Console.Clear();
                Console.WriteLine("0 - Set\\Unset fly mode");
                Console.WriteLine("1 - Set name");
                Console.WriteLine("2 - Set armor");
                Console.WriteLine("3 - Set weapon");
                Console.WriteLine("4 - Build hero");
                switch (GetCommand())
                {
                case 0:
                    isFlyHero = !isFlyHero;
                    break;

                case 1:
                    Console.Write("Name: ");
                    builder.SetName(Console.ReadLine());
                    break;

                case 2:
                    Console.Write("Armor: ");
                    builder.SetArmor(Console.ReadLine());
                    break;

                case 3:
                    Console.Write("Weapon: ");
                    builder.SetWeapon(Console.ReadLine());
                    break;

                case 4:
                    if (isFlyHero)
                    {
                        return(new FlyHeroDecorator(builder.Build()));
                    }
                    else
                    {
                        return(builder.Build());
                    }
                }
            } while (true);
        }
示例#2
0
    private void Start()
    {
        hero = HeroBuilder.Build(PLAYER_HERO_INDEX, this);
        AbilityButton.CreateButtonsForHero(hero);

        animator    = GetComponentInChildren <Animator>();
        destination = transform.position;
        newPosition = destination;
    }
示例#3
0
    private Character BuildCharacter(CharInfo charInfo, Transform initialSlot, bool isHero)
    {
        DivineDebug.Log("Building character " + charInfo.moniker.ToString() + " .");

        if (isHero)
        {
            return(HeroBuilder.Build(charInfo as HeroInfo, this, initialSlot.position, initialSlot.rotation));
        }
        else
        {
            return(CharBuilder.Build(charInfo, this, initialSlot.position, initialSlot.rotation));
        }
    }