本文整理汇总了C#中Score.AddSample方法的典型用法代码示例。如果您正苦于以下问题:C# Score.AddSample方法的具体用法?C# Score.AddSample怎么用?C# Score.AddSample使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Score
的用法示例。
在下文中一共展示了Score.AddSample方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultipleDifferentSamplesCanBeAddedAtPosition
public void MultipleDifferentSamplesCanBeAddedAtPosition()
{
var firstSample = new Sample("*");
var secondSample = new Sample("=");
var score = new Score();
score.AddSample(firstSample);
score.AddSample(secondSample);
Assert.IsTrue(score.Samples[0].Contains(firstSample));
Assert.IsTrue(score.Samples.First().Value.Contains(secondSample));
}
示例2: IdenticalSampleIsNotDuplicated
public void IdenticalSampleIsNotDuplicated()
{
const string key = "*";
var sample = new Sample(key);
var identicalSample = new Sample(key);
var score = new Score();
score.AddSample(sample);
score.AddSample(identicalSample);
Assert.That(score.Samples[0].Count(s => s.Type == key), Is.EqualTo(1));
}
示例3: ProgressAfterSetPositionMovesToNextBeat
public void ProgressAfterSetPositionMovesToNextBeat(int adjustment, int expectedNextPosition, int expectedLastPosition)
{
var dummySample = new Sample("=");
var expectedSample = new Sample("=");
var score = new Score();
score.Progress(); // position will now be eight
score.SetPosition(adjustment);
score.AddSample(dummySample);
score.Progress();
score.AddSample(expectedSample);
score.Progress();
score.AddSample(expectedSample);
Assert.That(score.Samples[expectedNextPosition].Contains(expectedSample));
Assert.That(score.Samples[expectedLastPosition].Contains(expectedSample));
}
示例4: AddSampleAddsSampleAtCurrentPosition
public void AddSampleAddsSampleAtCurrentPosition()
{
var sample = new Sample("*");
var score = new Score();
score.AddSample(sample);
Assert.That(score.Samples[0].Single(), Is.EqualTo(sample));
}
示例5: EarlyOffsetBeatAtStartOfScoreIsAtPositionZero
public void EarlyOffsetBeatAtStartOfScoreIsAtPositionZero()
{
var expected = new Sample("1");
var score = new Score();
score.SetPosition(-1);
score.AddSample(expected);
Assert.That(score.Samples[0], Contains.Item(expected));
}
示例6: SamplesAreAddedEightFramesApartAfterProgression
public void SamplesAreAddedEightFramesApartAfterProgression()
{
var firstSample = new Sample("*");
var secondSample = new Sample("=");
var score = new Score();
score.AddSample(firstSample);
score.Progress();
score.AddSample(secondSample);
Assert.That(score.Samples[0].Contains(firstSample));
Assert.That(score.Samples[8].Contains(secondSample));
}
示例7: SetPositionAllowsSamplesToBeAddedBeforeAndAfterTheBeat
public void SetPositionAllowsSamplesToBeAddedBeforeAndAfterTheBeat(int adjustment)
{
var sample = new Sample("*");
var score = new Score();
score.Progress(); // position will now be eight
score.SetPosition(adjustment);
score.AddSample(sample);
const int initialPosition = 8;
Assert.That(score.Samples[initialPosition + adjustment].Contains(sample));
}