Blame view

VRGNYMusicLights/Sources/Music.java 506 Bytes
742429d1   pfrison   VRGNYMusicLight b...
1
2
3
  
  public class Music {
  	private MusicPattern pattern;
a89c030d   pfrison   VRGNYMusicLights ...
4
5
  	private int[] lightTickDelais;
  	private double volume;
742429d1   pfrison   VRGNYMusicLight b...
6
  
a89c030d   pfrison   VRGNYMusicLights ...
7
  	public Music(MusicPattern pattern, MusicPath path, double volume) {
742429d1   pfrison   VRGNYMusicLight b...
8
  		this.pattern = pattern;
a89c030d   pfrison   VRGNYMusicLights ...
9
10
11
12
13
14
15
16
17
  		this.lightTickDelais = path.calculateTickDelais();
  		this.volume = volume;
  	}
  	
  	public double[] render(long tick) {
  		double[] lights = new double[lightTickDelais.length];
  		for(int i=0; i<lights.length; i++)
  			lights[i] = pattern.render(lightTickDelais[i] + tick) * volume;
  		return lights;
742429d1   pfrison   VRGNYMusicLight b...
18
19
  	}
  }