Exemple #1
0
        public FinCircularBuffer(int size, Func <T> generator)
        {
            this.impl_ = new FinArrayList <T>(size);
            for (var i = 0; i < size; ++i)
            {
                this.impl_[i] = generator();
            }

            this.index_ = new CircularRangedInt(0, 0, size);
        }
        public ItemSwitcherComponent(
            IGamepad gamepad,
            PlayerRigidbody playerRigidbody,
            PlayerSoundsComponent playerSounds,
            PlayerStateMachine stateMachine)
        {
            this.gamepad_ = gamepad;

            this.itemComponents_ = new IItemComponent[] {
                new ShieldComponent(gamepad,
                                    playerRigidbody,
                                    stateMachine),
                new WhipComponent(gamepad,
                                  playerRigidbody,
                                  playerSounds,
                                  stateMachine),
                new SwordComponent(gamepad,
                                   playerRigidbody,
                                   stateMachine),
            };
            this.currentItemIndex_ =
                new CircularRangedInt(0, 0, this.itemComponents_.Length);
        }