import { expect } from 'chai';
import 'mocha';

import {Vector2D} from '../../gun-tree-ts/vector';
import {Bullet} from '../../gun-tree-ts/bullet';
import {Effect} from '../../gun-tree-ts/effect';
import {Gun, AimingDirectionType, UnusableDirectionTypeError, MustContainSubGunsError}
    from '../../gun-tree-ts/gun-base';
import {FiringProperty} from '../../gun-tree-ts/player';
import {Wait, Combine} from '../../gun-tree-ts/gun-contents/gun-primitive';
import {DebuggerGunTreePlayer} from '../../gun-tree-ts/debugger/debugger-player';
import {CombinedModifier} 
    from '../../gun-tree-ts/gun-contents/gun-modifier-base';
import {AddAngle} 
    from '../../gun-tree-ts/gun-contents/gun-modifier-angle';
import {AddSpeed} 
    from '../../gun-tree-ts/gun-contents/gun-modifier-speed';


        const property = new FiringProperty(player);

        const angleOffset = 2;
        const speedOffset = 3;
        const gun = new CombinedModifier(
            new AddAngle(angleOffset),
            new AddSpeed(speedOffset)
        );
        gun.modifyProperty(property);
        expect(property.getAngle()).to.equals(angleOffset);
        expect(property.getSpeed()).to.equals(1 + speedOffset);
    });
    
    it('throw_exception_if_no_guns', () => {
        // Check exception.
        expect(() => {new CombinedModifier();}).to.throw(
            MustContainSubGunsError, 'CombinedModifier needs sub modifiers');
    });
});
describe('CombinedModifier_gun_unit_test', () => {
    it('modify_property', () => {
        const player = new DebuggerGunTreePlayer();