public static CardsGeneratorManager GetInstance()
        {
            if (_Instance == null)
            {
                _Instance = new CardsGeneratorManager();
            }

            return(_Instance);
        }
Пример #2
0
        public override void OnEnter()
        {
            _loadingForm = new LoadingForm
            {
                ControllerState = this
            };
            _loadingForm.Show();

            //Load Static Json DB - #TODO make this operation async
            CardsGeneratorManager Manager = CardsGeneratorManager.GetInstance();

            Manager.LoadData();

            TriggerTranstion(ProceedTransition);
        }
Пример #3
0
        public override void OnAction(Name Action, Name Param)
        {
            if (Action == BackAction)
            {
                TriggerTranstion(BackTransition);
            }
            else if (Action == GenerateCreatureAction || Action == GenerateEquipmentAction)
            {
                ECardRarity requestedRarity = ECardRarity.None;

                if (Param == CommonRarityParameter)
                {
                    requestedRarity = ECardRarity.Common;
                }
                else if (Param == MagicRarityParameter)
                {
                    requestedRarity = ECardRarity.Magic;
                }
                else if (Param == RareRarityParameter)
                {
                    requestedRarity = ECardRarity.Rare;
                }

                if (requestedRarity != ECardRarity.None)
                {
                    if (Action == GenerateCreatureAction)
                    {
                        CreatureCard creatureCard = CardsGeneratorManager.GetInstance().GenerateRandomCard <CreatureCard>(requestedRarity);
                        _generateRandomCardForm.DisplayCard(creatureCard);
                    }
                    else
                    {
                        EquipmentCard equipmentCard = CardsGeneratorManager.GetInstance().GenerateRandomCard <EquipmentCard>(requestedRarity);
                        _generateRandomCardForm.DisplayCard(equipmentCard);
                    }
                }
            }
        }
Пример #4
0
        private void GenerateMap()
        {
            BoardMap generatedMap = CardsGeneratorManager.GetInstance().GenerateMap();

            _form.SetMap(generatedMap);
        }