コード例 #1
0
ファイル: song.py プロジェクト: samuelschuler/CS4500
    def get_cube_id(self, note: Note) -> int:
        """Get the Cube ID for a corresponding note.

        :param note: The :class:`~song_match.song.note.Note` of the song.
        :return: :attr:`~cozmo.objects.LightCube.cube_id`
        """
        cube_id = self._notes.index(note) + 1
        return CubeMat.cube_id_to_position(cube_id)
コード例 #2
0
ファイル: song.py プロジェクト: samuelschuler/CS4500
    def get_note(self, cube_id: int) -> Note:
        """Get the :class:`~song_match.song.note.Note` for a corresponding cube.

        :param cube_id: :attr:`~cozmo.objects.LightCube.cube_id`
        :return: The :class:`~song_match.song.note.Note` of the cube.
        """
        mat_position = CubeMat.cube_id_to_position(cube_id)
        index = self._get_index(mat_position)
        return self._notes[index]
コード例 #3
0
ファイル: song.py プロジェクト: samuelschuler/CS4500
 def _get_index_from_mat_position(cls, cube_id: int):
     mat_position = CubeMat.cube_id_to_position(cube_id)
     return cls._get_index(mat_position)