示例#1
0
        public void ReturnAnIntegerHumanMove()
        {
            var board = new[]
            {
                _, _, _,
                _, _, _,
                _, _, _
            };

            var player = new TextPlayer(PlayerGlyph.Cross, new StringReader("0"), Console.Out);

            Assert.AreEqual(0, player.MakeMove(board));
        }
示例#2
0
 private int NoteToVelocity(TextPlayer.Note note)
 {
     return (int)(note.Volume * 127);
 }
示例#3
0
 private Pitch NoteToPitch(TextPlayer.Note note)
 {
     string type = note.Type.ToString().ToUpperInvariant();
     type += note.Sharp ? "Sharp" : "";
     type += note.Octave;
     return (Midi.Pitch)Enum.Parse(typeof(Midi.Pitch), type);
 }
示例#4
0
 public void PlayNote(int track, TextPlayer.Note note, TimeSpan end)
 {
     PlayNote(
         TrackToChannel(track),
         NoteToPitch(note),
         NoteToVelocity(note),
         end);
 }