Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 private int NoteToVelocity(TextPlayer.Note note)
 {
     return (int)(note.Volume * 127);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
 public void PlayNote(int track, TextPlayer.Note note, TimeSpan end)
 {
     PlayNote(
         TrackToChannel(track),
         NoteToPitch(note),
         NoteToVelocity(note),
         end);
 }