Beispiel #1
0

        
Beispiel #2
0
      public decimal BossSalaryBase(BossLevel lvl)
      {
          decimal sBase = 0;

          if (lvl == BossLevel.Head && this.MinBossLevel == BossLevel.Deputy)
          {
              sBase += this.BossSalary(BossLevel.Deputy);   // если вакансия - все равно учитываем эту зарплату


              //sBase = this.Panel.First((a) =>
              //{
              //    return (a.GetType() == typeof(Boss) && ((Boss)a).lvl == BossLevel.Deputy);
              //}).Salary();
          }

          sBase += this.SubalternSalary();

          foreach (var item in this.Childs)
          {
              sBase += (item.BossSalaryBase(BossLevel.Head) + item.BossSalary(BossLevel.Head));
          }

          return(sBase);

          //salary = (TotalSalary() - SalaryOfEqualOrHigherLvl(lvl)) * 0.15m; //для операций с decimal, чтобы не было проблем с типами, нужно приводить все явно!!!

          //return salary > 1300m ? salary : 1300m;
      }
Beispiel #3
0

        
Beispiel #4
0
 public Department(string Name, BossLevel MinBossLevel)
 {
     this.Name           = Name;
     this.id             = Department.NextId();
     this.minBossLevel   = MinBossLevel;
     this.headIsVacant   = true;
     this.deputyIsVacant = this.minBossLevel == 0 ? false : true;
     this.Childs         = new ObservableCollection <Department>();
     this.Panel          = new ObservableCollection <Employee>();
 }
Beispiel #5
0
        protected override void AI()
        {
            tryAttack();
            BossLevel  g               = Global.getBossLevel();
            GameObject closest         = g.getClosestObst(XRight());
            int        diffBetweenObst = 0;

            if (closest != null)
            {
                g.diffBetweenObst(closest);
            }
            float[] input = new float[6];
            ///input:
            /// 0 --> distance to next obsticle
            /// 1 --> next obsticle height
            /// 2 --> next obsticle width
            /// 3--> distance between the closest obsticle and the one after it
            /// 4--> player height
            /// 5 --> game speed
            if (closest == null)
            {
                input[0] = 0;
                input[1] = 0;
                input[2] = 0;
                input[3] = 0;
            }
            else
            {
                input[0] = ((closest.X() - XRight()) / 100);
                input[1] = closest.height() / 100;
                input[2] = closest.width() / 100;
                input[3] = (diffBetweenObst) / 100;
            }
            input[4] = (groundLevel - YBottom()) / 100;
            input[5] = (float)(g.groundVx / 10);

            float[] output = brain.getOutput(input);
            output = MathService.softmax(output);
            int result = MathService.getMaxIdx(output);

            if (result == 0)
            {
                jump(-32);      ///small jump
            }
            else if (result == 1)
            {
                jump(-40);      ///big jump
            }
            ///if result==3 --> do nothing
        }
Beispiel #6
0
    public void GenerateNewFloor()
    {
        Painter.LoadTiles();
        //CurrentFloor = GenerateRandomFloor(CurrentFloorNumber);
        Level level;

        BattleGrid.instance.tileMap.ClearAllTiles();
        BattleGrid.instance.DecorativeTileMap.Clear();
        if (CustomRun.instance.IsBossFloor(CurrentFloorNumber))
        {
            level = new BossLevel(BattleGrid.instance.tileMap, BattleGrid.instance.DecorativeTileMap);
        }
        else
        {
            level = new Level(BattleGrid.instance.tileMap, BattleGrid.instance.DecorativeTileMap);
        }
        CurrentFloor = new Floor(level, CurrentFloorNumber, 0);
        AllFloors.Append(CurrentFloor);
        CurrentFloor.BuildFloor();
        CurrentFloor.InstantiateFloor();
    }
Beispiel #7
0
        public GamePlatform BuildLevel(List <Player> players)
        {
            PlayerState state = CalculateState(players);

            IAbstractPlatform pl;

            if (CalculateIfBoss(state))
            {
                pl = new BossLevel(state);
            }
            else
            {
                pl = new NormalLevel(state);
            }

            return(new GamePlatform()
            {
                Monster = (AbstractMonster.AbstractMonster)pl.GetMonster(),
                //Scene = new NormalScene(true) {MonsterCount = 5, CurrentMonster = 1 }
                Scene = (AbstractScene.AbstractScene)pl.GetScene()
            });
        }
Beispiel #8
0
 void Start()
 {
     bossLevel = Camera.main.transform.GetComponent <BossLevel>();
     animator  = GetComponent <Animator>();
     isPlayer  = false;
 }
Beispiel #9
0
        public Boss(string FirstName, string LastName, string Position, Department Department, uint Age, BossLevel Lvl)
            : base(FirstName, LastName, Position, Department, Age)
        {
            if ((Lvl == BossLevel.Head && Department.HeadIsVacant) || (Lvl == BossLevel.Deputy && Department.DeputyIsVacant))
            {
                this.lvl = Lvl;
                //TODO сбросить флаг вакансии босса
            }

            else
            {
                throw new Exception($"Должность {Lvl} занята");
            }
        }
Beispiel #10
0
 protected override void Start()
 {
     bossLevel = Camera.main.transform.GetComponent <BossLevel>();
     text      = transform.GetChild(0).GetComponent <Text>();
     img       = transform.GetChild(1).GetComponent <Image>();
 }
Beispiel #11
0
 void NextWave()
 {
     state         = SpawnState.COUNTING;
     waveCountdown = timeBetweenWaves;
     if (nextWave + 1 > wave.Length - 1)
     {
         //Level Over
         Debug.Log("WAVE OVER");
         if (scene == 1)
         {
             nextWave = 0;
         }
         else if (scene == 2 || scene == 3)
         {
             state = SpawnState.WAITING;
             if (GameObject.FindGameObjectWithTag("Enemy") == null)
             {
                 Master.CompletedGame();
                 enabled = false;
             }
             else
             {
                 return;
             }
         }
         else if (scene == 0)
         {
             //Call Boss
             state = SpawnState.WAITING;
             if (bossCountDown <= 0)
             {
                 bossCountDown = 50;
                 for (int i = 0; i < Platforms.Length; i++)
                 {
                     Destroy(Platforms[i].gameObject);
                 }
                 BossLevel.SpawnBoss();
             }
             else if (bossCountDown == 50)
             {
                 state = SpawnState.WAITING;
                 if (GameObject.FindGameObjectWithTag("Enemy") == null)
                 {
                     Master.CompletedGame();
                     enabled = false;
                 }
                 else
                 {
                     return;
                 }
             }
             else
             {
                 bossCountDown -= Time.deltaTime;
             }
         }
     }
     nextWave++;
     wave[nextWave].count = wave[nextWave - 1].count + 1;
     wave[nextWave].rate  = wave[nextWave - 1].rate + 0.2f;
 }
Beispiel #12
0
      /// <summary>
      /// Считает всю зарплату департамента и всех дочерних департаментов
      /// </summary>
      /// <returns></returns>
      //public decimal TotalSalary()
      //{
      //    decimal total = this.Salary();
      //    if (this.Childs.Count > 0)
      //    {
      //        foreach (var item in Childs)
      //        {
      //            total += item.TotalSalary();
      //        }
      //    }
      //    return total;
      //}

      /// <summary>
      /// Считает, какая зарплата должна быть установлена начальнику исходя из зарплаты подчиненных по всей иерархии
      /// </summary>
      /// <param name="lvl"></param>
      /// <returns></returns>
      public decimal BossSalary(BossLevel lvl)
      {
          decimal salary = BossSalaryBase(lvl) * 0.15m;

          return(salary > 1300m ? salary : 1300m);
      }