Exemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            _barRenderers.Clear();

            _barRenderers.AddRange(this.Element.Bars.Select(b => new BarRenderer(this, this.Style, b)));

            _barRenderers.Initialize();
        }
Exemplo n.º 2
0
        public void InitializeTest()
        {
            var array = new List<object>[5];

            foreach (var value in array)
                Assert.Null(value);

            array.Initialize<List<object>>();

            foreach (var value in array)
                Assert.NotNull(value);
        }
 //[Button(ButtonSizes.Large)]
 private void BuildMap()
 {
     mapCubes = new List <GameObject> [squareLenght, squareLenght];
     mapCubes.Initialize();
     for (int i = 0; i < squareLenght; i++)
     {
         for (int j = 0; j < squareLenght; j++)
         {
             mapCubes[i, j] = cubesUsed;
         }
     }
 }
Exemplo n.º 4
0
        public override void Initialize()
        {
            base.Initialize();

            var notes = this.Element.NotesDefiner.Notes;

            if (notes != null)
            {
                _noteRenderers.AddRange(this.Element.IsTied
                                            ? notes.Select(n => new NoteRenderer(this, n.CloneAsTied()))
                                            : notes.Select(n => new NoteRenderer(this, n)));
            }

            _noteRenderers.Initialize();
        }
Exemplo n.º 5
0
        private List <LinkedListNode <int> > BuildNodeRefs(LinkedList <int> cups)
        {
            var result = new List <LinkedListNode <int> >(cups.Count + 1);

            result.Initialize(null, cups.Count + 1);

            var cur = cups.First;

            for (var i = 0; i < cups.Count; i++)
            {
                result[cur.Value] = cur;
                cur = cur.NextCircular();
            }

            return(result);
        }
Exemplo n.º 6
0
        //[Button(ButtonSizes.Large)]
        private void BuildMap()
        {
            mapCubes = new List <GameObject> [squareLenght, squareLenght];
            mapCubes.Initialize();
            for (int i = 0; i < squareLenght; i++)
            {
                for (int j = 0; j < squareLenght; j++)
                {
                    List <GameObject> randomCubes = new List <GameObject>();
                    for (int k = 0; k < cubesUsed.Count; k++)
                    {
                        var cube = Instantiate(cubesUsed[k], new Vector3(i, k, j), Quaternion.identity, parent);
                        randomCubes.Add(cube);
                        cube.SetActive(true);
                    }

                    mapCubes[i, j] = randomCubes;
                }
            }
        }
Exemplo n.º 7
0
        public override void Initialize()
        {
            base.Initialize();

            _columnRenderers.AddRange(this.Element.Columns.Select(c => new BarColumnRenderer(this, c)));

            _columnRenderers.Initialize();

            if (this.Element.BassVoice != null)
            {
                _voiceRenderers.Add(new BarVoiceRenderer(this, this.Element.BassVoice));
            }

            if (this.Element.TrebleVoice != null)
            {
                _voiceRenderers.Add(new BarVoiceRenderer(this, this.Element.TrebleVoice));
            }

            _voiceRenderers.Initialize();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Class costructor
        /// </summary>
        /// <param name="map">map cached previusly</param>
        /// <param name="alt">map altitude cached</param>
        /// <param name="x">max x of the map</param>
        /// <param name="y">max y of the map</param>
        /// <param name="index">index of the map</param>
        public MapMaker(Color[] map, Color[] alt, int x, int y,int index)
        {
            BitmapMap = map;
            BitmapMapZ = alt;
            var x1 = x + 10;
            var y1 = y + 10;
            var lenght = x1*y1;
            #region InitArrays
            _MapOcc = new int[lenght];
            _MapOcc.Initialize();

            _MapAlt = new int[lenght];
            _MapAlt.Initialize();

            _MapID = new int[x1*y1];
            _MapID.Initialize();

            _AddItemMap = new List<Item>[lenght];
            _AddItemMap.Initialize();

            _Tmp = new Color[lenght];
            _Tmp.Initialize();

            #endregion

            _X = x;
            _Y = y;

            MulDirectory = "";
            mapIndex = index;
            _stride = _X - 1;
            Random = new Random(DateTime.Now.Millisecond);

            AutomaticZMode = true;
        }
Exemplo n.º 9
0
    private IEnumerator ExecuteEnemyPhase()
    {
        yield return(new WaitForSeconds(0.5f));

        //get attack damage directed at each player
        List <EnemyAttack>[] groupAttacks = new List <EnemyAttack> [BattlePlayerBase.players.Count];
        groupAttacks.Initialize(() => new List <EnemyAttack>());

        for (int i = 0; i < groupAttacks.Length; i++)
        {
            foreach (EnemyBase e in aliveEnemies)
            {
                if (e.IsAlive && e.HasTargets)
                {
                    e.AttackPlayer(groupAttacks[i], i);
                }
            }
        }

        //apply attack damage on the players
        for (int i = 0; i < players.Count; i++)
        {
            BattlePlayerBase   bp   = players[i];
            List <EnemyAttack> hits = new List <EnemyAttack>();
            bool containedMiss      = false;

            foreach (EnemyAttack attack in groupAttacks[i])
            {
                if (attack.hit)
                {
                    hits.Add(attack);
                }
                else
                {
                    containedMiss = true;
                    attack.attacker.PlayAnimation(BattleAnimation.Attack);
                }
            }

            if (containedMiss)
            {
                bp.RpcMiss();
                yield return(new WaitForSeconds(0.5f));
            }

            if (hits.Count > 0)
            {
                List <BattleActorBase> attackers = new List <BattleActorBase>();
                foreach (EnemyAttack hit in hits)
                {
                    if (hit.apply != Stat.None)
                    {
                        if (bp.HasStatusEffect(Stat.Reflect))
                        {
                            hit.attacker.AddStatusEffect(hit.apply, hit.attacker, hit.duration);
                        }
                        else
                        {
                            bp.AddStatusEffect(hit.apply, hit.attacker, hit.duration);
                        }
                    }
                    hit.attacker.PlayAnimation(BattleAnimation.Attack);
                    attackers.Add(hit.attacker);
                }

                bp.DispatchBlockableDamage(attackers);
                yield return(new WaitForSeconds(0.5f));
            }
        }

        //apply damage over time status effects on enemies
        yield return(ApplyDOTs(aliveEnemies));

        DecrementStats(aliveEnemies);
        DecrementStats(players);

        yield return(new WaitForSeconds(0.1f));

        if (boss != null)
        {
            yield return(boss.ExecuteTurn());
        }
        else if (aliveEnemies.Count > 0 && IsEnemyPhase)
        {
            StartPlayerPhase();
        }
    }