Projects >> open2jam >>7533312e9558f795d85e432ad8ed5abf934a6ece

Chunk
Conflicting content
                );
    }

<<<<<<< HEAD
    private SystemTimer SysTimer = new SystemTimer();
    private SystemTimer timer = new SystemTimer();
=======
    /** play a sample */
    public void queueSample(Event.SoundSample sample)
    {
        Integer buffer = samples.get(sample.sample_id);
        if(buffer == null)return;


        if(!source_queue_iterator.hasNext())
            source_queue_iterator = source_queue.iterator();
        Integer head = source_queue_iterator.next();

        Integer source = head;

        while(SoundManager.isPlaying(source)){
            if(!source_queue_iterator.hasNext())
                source_queue_iterator = source_queue.iterator();
            source = source_queue_iterator.next();

            if(source.equals(head)){
                logger.warning("Source queue exausted !");
                return;
            }
        }

        SoundManager.setGain(source, sample.volume);
        SoundManager.setPan(source, sample.pan);
        SoundManager.play(source, buffer);
    }


    protected void updateHispeed()
    {
        judgment_line_y1 = skin.judgment_line;
        if(hispeed > 1){
            double off = JUDGMENT_SIZE * (hispeed-1);
            judgment_line_y1 -= off;
        }

        measure_size = 0.8 * hispeed * getViewport();

	updateHS = false;
    }

    public double getMeasureSize() { return measure_size; }
    public double getViewport() { return judgment_line_y2; }

    protected double judgmentArea()
    {
        // y2-y1 is the the upper half of the judgment area
        // 2*(y2-y1) is the total area
        // y1 + 2*(y2-y1) is the end line of the area
        // simplifying: y1 + 2*y2 - 2*y1 == 2*y2 - y1
        return 2 * judgment_line_y2 - judgment_line_y1;
    }

>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
    /**
    * initialize the common elements for the game.
    * this is called by the window render
Solution content
                );
    }

    /** play a sample */
    public void queueSample(Event.SoundSample sample)
    {
        Integer buffer = samples.get(sample.sample_id);
        if(buffer == null)return;


        if(!source_queue_iterator.hasNext())
            source_queue_iterator = source_queue.iterator();
        Integer head = source_queue_iterator.next();

        Integer source = head;

        while(SoundManager.isPlaying(source)){
            if(!source_queue_iterator.hasNext())
                source_queue_iterator = source_queue.iterator();
            source = source_queue_iterator.next();

            if(source.equals(head)){
                logger.warning("Source queue exausted !");
                return;
            }
        }

        SoundManager.setGain(source, sample.volume);
        SoundManager.setPan(source, sample.pan);
        SoundManager.play(source, buffer);
    }


    protected void updateHispeed()
    {
        judgment_line_y1 = skin.judgment_line;
        if(hispeed > 1){
            double off = JUDGMENT_SIZE * (hispeed-1);
            judgment_line_y1 -= off;
        }

        measure_size = 0.8 * hispeed * getViewport();

	updateHS = false;
    }

    public double getMeasureSize() { return measure_size; }
    public double getViewport() { return judgment_line_y2; }

    protected double judgmentArea()
    {
        // y2-y1 is the the upper half of the judgment area
        // 2*(y2-y1) is the total area
        // y1 + 2*(y2-y1) is the end line of the area
        // simplifying: y1 + 2*y2 - 2*y1 == 2*y2 - y1
        return 2 * judgment_line_y2 - judgment_line_y1;
    }

    /**
    * initialize the common elements for the game.
    * this is called by the window render
File
Render.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method declaration
Method invocation
Chunk
Conflicting content
            buffer_iterator = event_list.iterator();
	}

<<<<<<< HEAD
=======
        // load up initial buffer
        update_note_buffer(0);

>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
        // create sound sources
        source_queue = new LinkedList();
Solution content
            buffer_iterator = event_list.iterator();
	}

        // load up initial buffer
        update_note_buffer(0);

        // create sound sources
        source_queue = new LinkedList();
File
Render.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
        // wait a bit.. 5 seconds at min
        SysTimer.sleep((int) (5000 - (SysTimer.getTime() - lastLoopTime)));

<<<<<<< HEAD
        lastLoopTime = SysTimer.getTime();
        timer.startTimer();
    }

    /**
    * Notification that a frame is being rendered. Responsible for
    * running game logic and rendering the scene.
    */
    public void frameRendering()
    {
        // work out how long its been since the last update, this
        // will be used to calculate how far the entities should
        // move this loop
        long delta = SysTimer.getTime() - lastLoopTime;
        lastLoopTime = SysTimer.getTime();
        lastFpsTime += delta;
        fps++;
        
        // update our FPS counter if a second has passed
        if (lastFpsTime >= 1000) {
            logger.log(Level.FINEST, "FPS: {0}", fps);
            fps_entity.setNumber(fps);
            lastFpsTime = 0;
            fps = 0;

            //the timer counter
            if(second_entity.getNumber() >= 59)
            {
                second_entity.setNumber(0);
                minute_entity.incNumber();
            }
            else
                second_entity.incNumber();
        }

	if(AUTOPLAY)do_autoplay();
        else check_keyboard();

        if(updateHS)updateHispeed();
        
        update_note_buffer();

        Iterator> i = entities_matrix.iterator();

        while(i.hasNext()) // loop over layers
        {
            // get entity iterator from layer
            Iterator j = i.next().iterator();
            while(j.hasNext()) // loop over entities
            {
                Entity e = j.next();

                e.move(delta); // move the entity

                if(e instanceof NoteEntity) // if it's a note
                {
		    check_judgment((NoteEntity)e);
                } 
		else if (e.getY() >= getViewport()) // else, if it's on the line, judge it
		{
                    e.judgment();
                }

                if(!e.isAlive())j.remove();
                else e.draw();
            }
        }

        buffer_offset += note_speed * delta; // walk with the buffer

        if(!buffer_iterator.hasNext() && entities_matrix.isEmpty(note_layer)){
            for(Integer source : source_queue)
            {
                // this source is still playing, remove the sounds from the player
                if(SoundManager.isPlaying(source)){
                    last_sound.clear();
                    return;
                }
            }
            // all sources have finished playing
            window.destroy();
=======
        start_time = lastLoopTime = SystemTimer.getTime();
    }

    /** this returns the next note that needs to be played
     ** of the defined channel or NULL if there's
     ** no such note in the moment **/
    protected NoteEntity nextNoteKey(Event.Channel c)
    {
        if(note_channels.get(c).isEmpty())return null;
        NoteEntity ne = note_channels.get(c).getFirst();
        while(ne.getState() != NoteEntity.State.NOT_JUDGED &&
            ne.getState() != NoteEntity.State.LN_HOLD)
        {
            note_channels.get(c).removeFirst();
            if(note_channels.get(c).isEmpty())return null;
            ne = note_channels.get(c).getFirst();
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
        }
        return ne;
    }
Solution content
        // wait a bit.. 5 seconds at min
        SystemTimer.sleep((int) (5000 - (SystemTimer.getTime() - lastLoopTime)));

        start_time = lastLoopTime = SystemTimer.getTime();
    }

    /** this returns the next note that needs to be played
     ** of the defined channel or NULL if there's
     ** no such note in the moment **/
    protected NoteEntity nextNoteKey(Event.Channel c)
    {
        if(note_channels.get(c).isEmpty())return null;
        NoteEntity ne = note_channels.get(c).getFirst();
        while(ne.getState() != NoteEntity.State.NOT_JUDGED &&
            ne.getState() != NoteEntity.State.LN_HOLD)
        {
            note_channels.get(c).removeFirst();
            if(note_channels.get(c).isEmpty())return null;
            ne = note_channels.get(c).getFirst();
        }
        return ne;
    }
File
Render.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
For statement
If statement
Method invocation
Method signature
Variable
While statement
Chunk
Conflicting content
        return ne;
    }
    
<<<<<<< HEAD
    private double judgmentArea()
    {
        // y2-y1 is the the upper half of the judgment area
        // 2*(y2-y1) is the total area
        // y1 + 2*(y2-y1) is the end line of the area
        // simplifying: y1 + 2*y2 - 2*y1 == 2*y2 - y1
        return 2 * judgment_line_y2 - judgment_line_y1;
    }

    private void updateHispeed()
    {
        judgment_line_y1 = skin.judgment.start;
        if(hispeed > 1){
            double off = skin.judgment.size * (hispeed-1);
            judgment_line_y1 -= off;
        }

        measure_size = 0.8 * hispeed * getViewport();

	updateHS = false;
    }

    /** returns the note speed in pixels/milliseconds */
    public double getNoteSpeed() { return note_speed; }

    public double getMeasureSize() { return measure_size; }
    public double getViewport() { return judgment_line_y2; }

    private void check_judgment(NoteEntity ne)
    {
        String judge;
        switch (ne.getState())
        {
            case NOT_JUDGED: // you missed it (no keyboard input)
                if(ne.isAlive()
                        && ((ne instanceof LongNoteEntity && ne.getStartY() >= judgmentArea()) //needed by the ln head
                        || (ne.getY() >= judgmentArea())))
                {
                    if(judgment_entity != null)judgment_entity.setAlive(false);
                    judgment_entity = (JudgmentEntity) skin.getEntityMap().get("EFFECT_"+MISS_JUDGE).copy();
                    entities_matrix.add(judgment_entity);

                    note_counter.get(MISS_JUDGE).incNumber();
                    combo_entity.resetNumber();

                    update_screen_info(MISS_JUDGE,ne.getHit());
                    
                    note_channels.get(ne.getChannel()).removeFirst();
                    ne.setState(NoteEntity.State.TO_KILL);
                 }
            break;
            case JUDGE: //LN & normal ones: has finished with good result
                judge = skin.judgment.ratePrecision(ne.getHit());

                judge = update_screen_info(judge,ne.getHit());

                if(judgment_entity != null)judgment_entity.setAlive(false);
                judgment_entity = (JudgmentEntity) skin.getEntityMap().get("EFFECT_"+judge).copy();
                entities_matrix.add(judgment_entity);

		note_counter.get(judge).incNumber();

                System.out.println("EVENT "+ne.getTime()+" TIMER "+timer.getTime()+" DIFF "+(ne.getTime()-timer.getTime()));

		if(!judge.equals(MISS_JUDGE))
                {
		    Entity ee = skin.getEntityMap().get("EFFECT_CLICK_1").copy();
		    ee.setPos(ne.getX()+ne.getWidth()/2-ee.getWidth()/2,
		    getViewport()-ee.getHeight()/2);
		    entities_matrix.add(ee);

		    if(ne.getHit() >= skin.judgment.combo_threshold)combo_entity.incNumber();
		    else {
                        if(judge.equals("JUDGMENT_GOOD"))combo_entity.incNumber(); //because of the pills
                        else combo_entity.resetNumber();
                    }
                    if(ne instanceof LongNoteEntity)ne.setState(NoteEntity.State.TO_KILL);
                    else ne.setAlive(false);
                } else {
                    combo_entity.resetNumber();
                    ne.setState(NoteEntity.State.TO_KILL);
                }
                last_sound.put(ne.getChannel(), ne.getSample());
                note_channels.get(ne.getChannel()).removeFirst();
            break;
            case LN_HEAD_JUDGE: //LN: Head has been played
                judge = skin.judgment.ratePrecision(ne.getHit());

                judge = update_screen_info(judge,ne.getHit());

                if(judgment_entity != null)judgment_entity.setAlive(false);
                judgment_entity = (JudgmentEntity) skin.getEntityMap().get("EFFECT_"+judge).copy();
                entities_matrix.add(judgment_entity);

		note_counter.get(judge).incNumber();

		if(!judge.equals(MISS_JUDGE))
                {
		    Entity ee = skin.getEntityMap().get("EFFECT_LONGFLARE").copy();
		    ee.setPos(ne.getX()+ne.getWidth()/2-ee.getWidth()/2,ee.getY());
		    entities_matrix.add(ee);
                    Entity to_kill = longflare.put(ne.getChannel(),(AnimatedEntity) ee);
                    if(to_kill != null)to_kill.setAlive(false);
		    
		    ee = skin.getEntityMap().get("EFFECT_CLICK_1").copy();
		    ee.setPos(ne.getX()+ne.getWidth()/2-ee.getWidth()/2,
		    getViewport()-ee.getHeight()/2);
		    entities_matrix.add(ee);

		    if(ne.getHit() >= skin.judgment.combo_threshold)combo_entity.incNumber();
		    else {
                        if(judge.equals("JUDGMENT_GOOD"))combo_entity.incNumber(); //because of the pills
                        else combo_entity.resetNumber();
                    }
                    ne.setState(NoteEntity.State.LN_HOLD);
                }
                last_sound.put(ne.getChannel(), ne.getSample());
            break;
            case LN_HOLD:    // You keept too much time the note held that it misses
                if(ne.isAlive() && ne.getY() >= judgmentArea())
                {
                    if(judgment_entity != null)judgment_entity.setAlive(false);
                    judgment_entity = (JudgmentEntity) skin.getEntityMap().get("EFFECT_"+MISS_JUDGE).copy();
                    entities_matrix.add(judgment_entity);

                    note_counter.get(MISS_JUDGE).incNumber();
                    combo_entity.resetNumber();

                    update_screen_info(MISS_JUDGE,ne.getHit());

                    note_channels.get(ne.getChannel()).removeFirst();
                    ne.setState(NoteEntity.State.TO_KILL);
                 }
            break;
            case TO_KILL: // this is the "garbage collector", it just removes the notes off window
                if(ne.isAlive() && ne.getY() >= window.getResolutionHeight())
                {
                    // kill it
                    ne.setAlive(false);
        else if(judge.equals("JUDGMENT_MISS"))
                }
            break;
        }
    }

    /**
     * TODO It would be nice to move all the check_judgment non judgment things to this function
     * (bars, combos, counter, etc)
     * @param judge
     * @return judge
     */
    private String update_screen_info(String judge, double hit)
    {
        int score_value = 0;
        if(judge.equals("JUDGMENT_COOL"))
        {
            jambar_entity.addNumber(2);
            consecutive_cools++;
            if(lifebar_entity.getNumber() <= lifebar_entity.getLimit())lifebar_entity.addNumber(100);

            score_value = 200 + (jamcombo_entity.getNumber()*10);
        }
        else if(judge.equals("JUDGMENT_GOOD"))
        {
            jambar_entity.addNumber(1);
            consecutive_cools = 0;
            if(lifebar_entity.getNumber() <= lifebar_entity.getLimit())lifebar_entity.addNumber(50);

             score_value = 100;
        }
        else if(judge.equals("JUDGMENT_BAD"))
        {
            if(pills > 0)
            {
                judge = "JUDGMENT_GOOD";
                jambar_entity.addNumber(1);
                pills--;
                pills_draw.getLast().setAlive(false);

                score_value = 100; // TODO: not sure
            }
            else
            {
                jambar_entity.setNumber(0);
                jamcombo_entity.resetNumber();

                score_value = 4;
            }
            consecutive_cools = 0;
            if(lifebar_entity.getNumber() <= lifebar_entity.getLimit())lifebar_entity.addNumber(30);
        }
        {
            jambar_entity.setNumber(0);
            jamcombo_entity.resetNumber();
            consecutive_cools = 0;

            if(lifebar_entity.getNumber() >= 30)lifebar_entity.addNumber(-30);

            if(score_entity.getNumber() >= 10)score_value = -10;
            else score_value = -score_entity.getNumber();
        }

        score_entity.addNumber(score_value);

        if(jambar_entity.getNumber() >= jambar_entity.getLimit())
        {
            jambar_entity.setNumber(0); //reset
            jamcombo_entity.incNumber();
        }

        if(consecutive_cools >= 15 && pills < 5)
        {
            consecutive_cools -= 15;
            pills++;
            Entity ee = skin.getEntityMap().get("PILL_"+pills).copy();
            entities_matrix.add(ee);
            pills_draw.add(ee);
        }

        if(combo_entity.getNumber() > 1 && maxcombo_entity.getNumber()<(combo_entity.getNumber()-1))
        {
            maxcombo_entity.incNumber();
        }

        hit_sum += hit;
        if(!judge.equals(MISS_JUDGE))hit_count++;
        total_notes++;
        
        return judge;
    }

    private void do_autoplay()
    {
        for(Map.Entry entry : keyboard_map.entrySet())
        {
            Event.Channel c = entry.getKey();
            if(note_channels.get(c).isEmpty())continue;

            NoteEntity ne = note_channels.get(c).getFirst();

            if(ne.getStartY() < judgment_line_y2)continue; //sync
//            if((long)ne.getTime() <= timer.getTime()) continue;
            if(ne.getState() != NoteEntity.State.NOT_JUDGED &&
                    ne.getState() != NoteEntity.State.LN_HOLD)continue;

            double hit = ne.testHit(judgment_line_y1, judgment_line_y2);
            if(hit < AUTOPLAY_THRESHOLD)continue;
            ne.setHit(hit);
            
            if(ne instanceof LongNoteEntity)
            {
                if(ne.getState() == NoteEntity.State.NOT_JUDGED)
                {
                    queueSample(ne.getSample());
                    ne.setState(NoteEntity.State.LN_HEAD_JUDGE);
                    Entity ee = skin.getEntityMap().get("PRESSED_"+ne.getChannel()).copy();
                    entities_matrix.add(ee);
                    Entity to_kill = key_pressed_entity.put(ne.getChannel(), ee);
                    if(to_kill != null)to_kill.setAlive(false);
                }
                else if(ne.getState() == NoteEntity.State.LN_HOLD)
                {
                    ne.setState(NoteEntity.State.JUDGE);
                    longflare.get(ne.getChannel()).setAlive(false); //let's kill the longflare effect
                    key_pressed_entity.get(ne.getChannel()).setAlive(false);
                }
            }
            else
            {
                queueSample(ne.getSample());
                ne.setState(NoteEntity.State.JUDGE);
            }
        }
    }

    private void check_keyboard()
    {
        /* Misc keys
         * Like up and down
         */
        if(window.isKeyDown(java.awt.event.KeyEvent.VK_UP) && !updateHS)
        {
            if(hispeed > 0.5 || hispeed < 10)
            {
                hispeed += 0.5;
                updateHS = true;
            }
            return;
        }
        if(window.isKeyDown(java.awt.event.KeyEvent.VK_DOWN) && !updateHS)
        {
            if(hispeed > 0.5 || hispeed < 10)
            {
                hispeed -= 0.5;
                updateHS = true;
            }
            return;
        }

	for(Map.Entry entry : keyboard_map.entrySet())
        {
            Event.Channel c = entry.getKey();
            if(window.isKeyDown(entry.getValue())) // this key is being pressed
            {
                if(keyboard_key_pressed.get(c) == false){ // started holding now
                    keyboard_key_pressed.put(c, true);

                    Entity ee = skin.getEntityMap().get("PRESSED_"+c).copy();
                    entities_matrix.add(ee);
                    Entity to_kill = key_pressed_entity.put(c, ee);
                    if(to_kill != null)to_kill.setAlive(false);

                    if(note_channels.get(c).isEmpty()){
                        Event.SoundSample i = last_sound.get(c);
                        if(i != null)queueSample(i);
                        continue;
                    }

                    NoteEntity e = note_channels.get(c).getFirst();

                    if(e.getState() == NoteEntity.State.TO_KILL)continue;

                    queueSample(e.getSample());

                    double hit = e.testHit(judgment_line_y1, judgment_line_y2);
                    
                    String judge = skin.judgment.ratePrecision(hit);
                    e.setHit(hit);

                    /* we compare the judgment with a MISS, misses should be ignored here,
                     * because this is the case where the player pressed the note so soon
                     * that it's worse than BAD ( 20% or below on o2jam) so we need to let
                     * it pass like nothing happened */
                    if(!judge.equals(MISS_JUDGE)){
                        if(e instanceof LongNoteEntity){
                            longnote_holded.put(c, (LongNoteEntity) e);
                            if(e.getState() == NoteEntity.State.NOT_JUDGED)
				e.setState(NoteEntity.State.LN_HEAD_JUDGE);
                        }else{
                            e.setState(NoteEntity.State.JUDGE);
                        }
                    }
                }
            }
            else
            if(keyboard_key_pressed.get(c) == true) { // key released now

                keyboard_key_pressed.put(c, false);
                key_pressed_entity.get(c).setAlive(false);

                LongNoteEntity e = longnote_holded.remove(c);

                Entity lf = longflare.remove(c);
                if(lf !=null)lf.setAlive(false);
=======
    
    private int buffer_measure = 0;
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1

    private double fractional_measure = 1;
Solution content
        return ne;
    }
    
    
    private int buffer_measure = 0;

    private double fractional_measure = 1;
File
Render.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
For statement
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
            Event e = buffer_iterator.next();
            while(e.getMeasure() > buffer_measure) // this is the start of a new measure
            {
<<<<<<< HEAD
                buffer_timer += ((this.bpm/240) * (1-buffer_measure_pointer) * (measure_size*fractional_measure/hispeed))*10;
                buffer_measure_pointer = 0.0;


                buffer_offset -= measure_size * fractional_measure;
=======
                buffer_timer += 1000 * ( 240/buffer_bpm * (fractional_measure-buffer_measure_pointer) );
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
                MeasureEntity m = (MeasureEntity) skin.getEntityMap().get("MEASURE_MARK").copy();
                m.setTime(buffer_timer);
                entities_matrix.add(m);
Solution content
            Event e = buffer_iterator.next();
            while(e.getMeasure() > buffer_measure) // this is the start of a new measure
            {
                buffer_timer += 1000 * ( 240/buffer_bpm * (fractional_measure-buffer_measure_pointer) );
                MeasureEntity m = (MeasureEntity) skin.getEntityMap().get("MEASURE_MARK").copy();
                m.setTime(buffer_timer);
                entities_matrix.add(m);
File
Render.java
Developer's decision
Version 2
Kind of conflict
Attribute
Chunk
Conflicting content
                buffer_measure_pointer = 0;
            }

<<<<<<< HEAD
            buffer_timer += ((this.bpm/240) * (e.getPosition()-buffer_measure_pointer) * (measure_size*fractional_measure/hispeed))*10;
            buffer_measure_pointer = e.getPosition();

            double abs_height = buffer_offset - (e.getPosition() * measure_size);
=======
            buffer_timer += 1000 * ( 240/buffer_bpm * (e.getPosition()-buffer_measure_pointer) );
            buffer_measure_pointer = e.getPosition();
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1

            switch(e.getChannel())
            {
Solution content
                buffer_measure_pointer = 0;
            }

            buffer_timer += 1000 * ( 240/buffer_bpm * (e.getPosition()-buffer_measure_pointer) );
            buffer_measure_pointer = e.getPosition();

            switch(e.getChannel())
            {
File
Render.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Variable
Chunk
Conflicting content
                break;

                case BPM_CHANGE:
<<<<<<< HEAD
                entities_matrix.add(new BPMEntity(this,e.getValue(),abs_height, buffer_timer));
=======
                buffer_bpm = e.getValue();
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
                break;

                case NOTE_1:case NOTE_2:
Solution content
                break;

                case BPM_CHANGE:
                buffer_bpm = e.getValue();
                break;

                case NOTE_1:case NOTE_2:
File
Render.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
                    if(lne == null){
                        logger.log(Level.WARNING, "Attempted to RELEASE note {0}", e.getChannel());
                    }else{
<<<<<<< HEAD
                        lne.setEndY(abs_height);
                        lne.setTime(buffer_timer);
=======
                        lne.setEndTime(buffer_timer,velocity_integral(lne.getTime(),buffer_timer));
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
                    }
                }
                break;
Solution content
                    if(lne == null){
                        logger.log(Level.WARNING, "Attempted to RELEASE note {0}", e.getChannel());
                    }else{
                        lne.setEndTime(buffer_timer,velocity_integral(lne.getTime(),buffer_timer));
                    }
                }
                break;
File
Render.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
                case AUTO_PLAY:
                case NOTE_SC:
<<<<<<< HEAD
                entities_matrix.add(new SampleEntity(this,e.getSample(),abs_height, buffer_timer));
=======
                SampleEntity s = new SampleEntity(this,e.getSample(),0);
                s.setTime(buffer_timer);
                entities_matrix.add(s);
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
                break;
            }
        }
Solution content
                case AUTO_PLAY:
                case NOTE_SC:
                SampleEntity s = new SampleEntity(this,e.getSample(),0);
                s.setTime(buffer_timer);
                entities_matrix.add(s);
                break;
            }
        }
File
Render.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    private Event.SoundSample value;
    private Render render;

<<<<<<< HEAD
    public SampleEntity(Render r, Event.SoundSample value, double y, double t)
=======
    private long time_to_hit;

    public SampleEntity(Render r, Event.SoundSample value, double y)
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
    {
        this.render = r;
        this.value = value;
Solution content
        this.render = r;
    private Event.SoundSample value;
    private Render render;

    private long time_to_hit;

    public SampleEntity(Render r, Event.SoundSample value, double y)
    {
        this.value = value;
File
SampleEntity.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method signature
Chunk
Conflicting content
 * @author fox
 */
public class SystemTimer {
<<<<<<< HEAD
    /** The number of "timer ticks" per second */
    private final long timerTicksPerMilli = 1000000L;// 10^6
    private long ticks = 0;
    private long start;

    /**
    * Starts the timer running. The number of ticks is reset to zero and the timer is synchronized with the
    * leading edge of the wave.
    */
    public void SystemTimer()
    {
       startTimer();
    }

    public void startTimer()
    {
        long time = System.nanoTime();
        long prev_time = time;

        ticks = 0;

        //Synchronize our timer
        while(time == prev_time)time = System.nanoTime();
        start = System.nanoTime();
    }
=======
    /** The number of nanoseconds per millisecond */
    private static final int nanoTicksPerMilli = 1000000;// 10^6
	
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
    /**
     * Get the high resolution time in milliseconds
     *
Solution content
 * @author fox
 */
public class SystemTimer {
    /** The number of nanoseconds per millisecond */
    private static final int nanoTicksPerMilli = 1000000;// 10^6
	
    /**
     * Get the high resolution time in milliseconds
     *
File
SystemTimer.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method declaration
Chunk
Conflicting content
    }
     *
     * @return The high resolution time in milliseconds
     */
<<<<<<< HEAD
    public long getTime() {
        // we get the "timer ticks" from the high resolution timer
        // then divide by the number of ticks in a millisecond giving
        // us a nice clear time in milliseconds
        return getClockTicks() / timerTicksPerMilli;

    /**
    * Returns the number of clock ticks since the timer was started. If the timer is stopped,
    * the number of ticks will be frozen at the duration between when the clock was started and
    * stopped.
    *
    * @return Number of ticks since the clock started.
    */

    public long getClockTicks()
    {
        ticks = (System.nanoTime()-start);
        return ticks;
=======
    public static long getTime() {
        return System.nanoTime() / nanoTicksPerMilli;
>>>>>>> 5c459cc92b78333cde6c656149ea034833a499f1
    }
	
    public void sleep(int milli)
Solution content
     *
     * @return The high resolution time in milliseconds
     */
    public static long getTime() {
        return System.nanoTime() / nanoTicksPerMilli;
    }
	
File
SystemTimer.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method declaration
Method invocation
Method signature
Return statement