Exemple #1
0
        /// <summary>
        /// Makes a new <see cref="Bee"/>
        /// </summary>
        /// <param name="beeType">The type of bee to make, <see cref="BeeType"/></param>
        /// <param name="queen">The stats the new <see cref="Bee"/> should be made with, <see cref="QueenBee"/></param>
        /// <returns>A new <see cref="Bee"/></returns>
        public Bee MakeBee(BeeType beeType, QueenBee queen)
        {
            //* gives all of the primary and secondary stats to the bee
            NormalBee nb = new NormalBee()
            {
                pSpecies = CombineSpecies(queen.queen.sSpecies, queen.drone.sSpecies),
                sSpecies = CombineSpecies(queen.queen.sSpecies, queen.drone.sSpecies),

                pEffect = CombineEffect(queen.queen.sEffect, queen.drone.sEffect),
                sEffect = CombineEffect(queen.queen.sEffect, queen.drone.sEffect),

                pFertility = CombineFertility(queen.queen.sFertility, queen.drone.sFertility),
                sFertility = CombineFertility(queen.queen.sFertility, queen.drone.sFertility),

                pLifespan = CombineLifespan(queen.queen.sLifespan, queen.drone.sLifespan),
                sLifespan = CombineLifespan(queen.queen.sLifespan, queen.drone.sLifespan),

                pProdSpeed = CombineProductionSpeed(queen.queen.sProdSpeed, queen.drone.sProdSpeed),
                sProdSpeed = CombineProductionSpeed(queen.queen.sProdSpeed, queen.drone.sProdSpeed)
            };

            //QuestEvents.CallBeeCraftedEvent(nb.pSpecies);

            //* returns the new bee
            return(new Bee(beeType, nb));
        }
Exemple #2
0
        /// <summary>
        /// Make a bee with given stats
        /// </summary>
        /// <param name="beeType"><see cref="BeeType"/></param>
        /// <param name="species"><see cref="BeeSpecies"/></param>
        /// <param name="lifespan"><see cref="BeeLifeSpan"/></param>
        /// <param name="fertility">1 or greater</param>
        /// <param name="effect"><see cref="BeeEffect"/></param>
        /// <param name="prodSpeed"><see cref="BeeProductionSpeed"/></param>
        /// <returns>A <see cref="Bee"/> with the given stats</returns>
        public Bee MakeBeeWithStats(BeeType beeType = BeeType.DRONE, BeeSpecies species = BeeSpecies.FOREST, BeeLifeSpan lifespan = BeeLifeSpan.NORMAL, uint fertility = 2, BeeEffect effect = BeeEffect.NONE, BeeProductionSpeed prodSpeed = BeeProductionSpeed.NORMAL)
        {
            NormalBee normBee = new NormalBee()
            {
                pSpecies   = species,
                pLifespan  = lifespan,
                pFertility = fertility,
                pProdSpeed = prodSpeed,
                pEffect    = effect,
                sEffect    = effect,
                sFertility = fertility,
                sLifespan  = lifespan,
                sProdSpeed = prodSpeed,
                sSpecies   = species
            };

            switch (beeType)
            {
            case BeeType.QUEEN:
                return(new Bee(beeType, new QueenBee(normBee, normBee)));

            default:
                return(new Bee(beeType, normBee));
            }
        }
Exemple #3
0
 public Bee(BeeType beetype, int lifespan, int id)
 {
     beeType  = beetype;
     lifeSpan = lifespan;
     status   = BeeStatus.Alive;
     beeId    = id;
 }
Exemple #4
0
 public Bee(BeeType beeType)
 {
     ID               = Guid.NewGuid();
     Health           = 100.0F;
     Type             = beeType;
     IsDead           = false;
     HealthResistance = ComputeHealthResistance(beeType);
 }
Exemple #5
0
 public void Show(int speciesIndex, int beeIndex, BeeType beeType, string count)
 {
     descriptionArea.Setup(inventoryManager.GetBee(speciesIndex, beeIndex, beeType), count);
     descriptionArea.transform.localPosition = new Vector3(0f, -700f, 0f);
     //scrollArea.GetComponent<RectTransform>().sizeDelta = new Vector2(0f, 950f);
     //scrollArea.transform.localPosition = new Vector3(0f, -255f, 0f);
     descriptionArea.transform.gameObject.SetActive(true);
     //StartCoroutine(SetScrollDown());
 }
    public Bee GetBee(int speciesIndex, int beeIndex, BeeType typeIndex)
    {
        if (typeIndex == BeeType.Drone)
        {
            if (beeIndex == -1)
            {
                int index = Random.Range(0, listDrone[speciesIndex].list.Count);
                listDrone[speciesIndex].list[index].count--;
                listDrone[speciesIndex].count--;
                Bee bee = listDrone[speciesIndex].list[index].bee;

                if (listDrone[speciesIndex].list[index].count == 0)
                {
                    listDrone[speciesIndex].list.RemoveAt(index);
                    if (listDrone[speciesIndex].count == 0)
                    {
                        listDrone.RemoveAt(speciesIndex);
                    }
                }

                return(bee);
            }
            else
            {
                return(listDrone[speciesIndex].list[beeIndex].bee);
            }
        }
        else if (typeIndex == BeeType.Princess)
        {
            if (beeIndex == -1)
            {
                int index = Random.Range(0, listPrincess[speciesIndex].list.Count);
                listPrincess[speciesIndex].list[index].count--;
                listPrincess[speciesIndex].count--;
                Bee bee = listPrincess[speciesIndex].list[index].bee;
                if (listPrincess[speciesIndex].list[index].count == 0)
                {
                    listPrincess[speciesIndex].list.RemoveAt(index);
                    if (listPrincess[speciesIndex].count == 0)
                    {
                        listPrincess.RemoveAt(speciesIndex);
                    }
                }
                return(bee);
            }
            else
            {
                return(listPrincess[speciesIndex].list[beeIndex].bee);
            }
        }
        else
        {
            Debug.Log("[GetBee] somthing go wrong");
            return(null);
        }
    }
Exemple #7
0
    public Bee(Allele allele, BeeType beeType)
    {
        type  = beeType;
        pairs = new List <PairChromosome>();

        pairs.Add(new PairChromosome(allele.species));
        pairs.Add(new PairChromosome(allele.speed));
        pairs.Add(new PairChromosome(allele.lifeSpan));
        pairs.Add(new PairChromosome(allele.fertility));
    }
Exemple #8
0
 /// <summary>
 /// Create a bee from <see cref="QueenBee"/>
 /// </summary>
 /// <param name="beeType"><see cref="BeeType"/> of the bee</param>
 /// <param name="normalBee"><see cref="QueenBee"/> data</param>
 public Bee(BeeType beeType, QueenBee queenBee) : base(new CultureInfo("en-US", false).TextInfo.ToTitleCase($"{queenBee.queen.pSpecies} {beeType}".ToLower()))
 {
     usesGameObject = true;
     if (beeType == BeeType.PRINCESS || beeType == BeeType.QUEEN)
     {
         maxStack = 1;
     }
     this.beeType  = beeType;
     this.queenBee = queenBee;
 }
Exemple #9
0
    public void init(BeeType type, string beeName, Color color)
    {
        this.type    = type;
        this.beeName = beeName;
        this.color   = color;

        visitedTiles = new HashSet <TileController>();

        workQueue        = new List <WorkUnit>(maxQueueCapacity);
        workQueueChanged = true;
    }
Exemple #10
0
 public void Setup(Sprite sprite, int count, StorageHendler sm, ItemType itemType, object item, BeeType beeType = BeeType.Drone, int index = -1)
 {
     icon.sprite     = sprite;
     this.count.text = count.ToString();
     storageManager  = sm;
     this.itemType   = itemType;
     this.item       = item;
     this.beeType    = beeType;
     indexSpecies    = index;
     icon.transform.gameObject.SetActive(true);
     this.count.transform.gameObject.SetActive(true);
 }
Exemple #11
0
 public void RenderBeeItemsPage(int index, BeeType beeType)
 {
     Debug.Log($"{_inventoryManager.listDrone.Count} {index}");
     if (beeType == BeeType.Drone)
     {
         RenderPage(_inventoryManager.listDrone[index].list, index);
     }
     else if (beeType == BeeType.Princess)
     {
         RenderPage(_inventoryManager.listPrincess[index].list, index);
     }
 }
Exemple #12
0
 public SpeciesItem(List <BeeItem> list)
 {
     this.list = list;
     count     = 1;
     if (list.Count > 0)
     {
         species = list[0].bee.GetSpecies();
         beeType = list[0].bee.type;
     }
     else
     {
         Debug.LogError("[SpeciesItem] Empty list!");
     }
 }
Exemple #13
0
        public void Bee_dead_status_should_update_with_damage(BeeType type, int damage, bool dead)
        {
            var bee = new Bee
            {
                BeeType = type,
                Health  = 100,
                Name    = "Test bee"
            };

            var beeService = new IndexBase();

            beeService.DamageBee(bee, damage);
            Assert.Equal(dead, bee.Dead);
        }
Exemple #14
0
        private float ComputeHealthResistance(BeeType beeType)
        {
            switch (beeType)
            {
            case BeeType.Worker:
                return(BeeConstants.WORKER_HEALTH_RESISTANCE);

            case BeeType.Queen:
                return(BeeConstants.QUEEN_HEALTH_RESISTANCE);

            case BeeType.Drone:
                return(BeeConstants.DRONE_HEALTH_RESISTANCE);

            default:
                return(0.0F);
            }
        }
Exemple #15
0
        /// <summary>
        /// This method computes the bee resistance based on the bee type.
        /// </summary>
        /// <param name="beeType">The type of bee (woroker, queen, etc.)</param>
        /// <returns>Returns a float with the maximum bee health resistance.</returns>
        private float GetHealthResistance(BeeType beeType)
        {
            switch (beeType)
            {
            case BeeType.Worker:
                return(70.0F);

            case BeeType.Queen:
                return(20.0F);

            case BeeType.Drone:
                return(50.0F);

            default:
                return(0.0F);
            }
        }
        /// <summary>
        /// Обновить состояние согласно типу только
        /// что рожденной пчелы.
        /// </summary>
        /// <param name="newBeeType">Тип рожденной пчелы.</param>
        private void ChangeStateAccordingToNewBee(BeeType newBeeType)
        {
            switch (newBeeType)
            {
            case BeeType.Worker:
                this.state.IncrementWorkerBeesCount();
                break;

            case BeeType.Guard:
                this.state.IncrementGuardsCount();
                break;

            case BeeType.Queen:
                this.state.IncrementQueensCount();
                break;

            default:
                throw new ArgumentOutOfRangeException(
                          $"Неизвестный тип пчелы - {newBeeType}",
                          nameof(newBeeType));
            }

            this.state.IncrementBeesInsideCount();
        }
Exemple #17
0
 public Bee(BeeType beeType)
 {
     BeeType = beeType;
     HitPoints = beeType.MaxHitPoints;
 }
Exemple #18
0
 public Bee(BeeType type)
 {
     CurrentBee       = type;
     CurrentBeeStatus = BeeStatus.Alive;
     Health           = 100.00F;
 }
Exemple #19
0
 public Bee(Bee parent1, Bee parent2, BeeType beeType)
 {
     type  = beeType;
     pairs = Inherit(parent1.pairs, parent2.pairs);
 }
Exemple #20
0
 public Bee(BeeType type)
 {
     health      = 100;
     beetype     = type;
     aliveorDead = true;
 }