Skip to content

Commit

Permalink
🔥 (ContentKit): Remove instructions payload for MIDIRecordingPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Jan 24, 2024
1 parent 05748f9 commit 747809e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ sequence:
- instructions: Joue les notes de la même couleur que Leka
interface: melody
payload:
instructions:
text_music_selection: Sélection de la musique
text_button_play: Jouer
text_keyboard_partial: Clavier partiel
text_keyboard_full: Clavier entier
instrument: xylophone
songs:
- underTheMoonlight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

// swiftlint:disable nesting
public enum MidiRecordingPlayer {
public struct Payload: Codable {
// MARK: Lifecycle

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.instructions = try container.decode(Instructions.self, forKey: .instructions)
self.instrument = try container.decode(String.self, forKey: .instrument)

let midiRecordingSongs = try container.decode([MidiRecording.Song].self, forKey: .songs)
Expand All @@ -18,57 +16,14 @@ public enum MidiRecordingPlayer {

// MARK: Public

public struct Instructions: Codable {
// MARK: Lifecycle

public init(
textMusicSelection: String, textButtonPlay: String, textKeyboardPartial: String,
textKeyboardFull: String
) {
self.textMusicSelection = textMusicSelection
self.textButtonPlay = textButtonPlay
self.textKeyboardPartial = textKeyboardPartial
self.textKeyboardFull = textKeyboardFull
}

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)

self.textMusicSelection = try container.decode(String.self, forKey: .textMusicSelection)
self.textButtonPlay = try container.decode(String.self, forKey: .textButtonPlay)
self.textKeyboardPartial = try container.decode(String.self, forKey: .textKeyboardPartial)
self.textKeyboardFull = try container.decode(String.self, forKey: .textKeyboardFull)
}

// MARK: Public

public let textMusicSelection: String
public let textButtonPlay: String
public let textKeyboardPartial: String
public let textKeyboardFull: String

// MARK: Internal

enum CodingKeys: String, CodingKey {
case textMusicSelection = "text_music_selection"
case textButtonPlay = "text_button_play"
case textKeyboardPartial = "text_keyboard_partial"
case textKeyboardFull = "text_keyboard_full"
}
}

public let instructions: Instructions
public let instrument: String
public let songs: [MidiRecording]

// MARK: Internal

enum CodingKeys: String, CodingKey {

Check warning on line 24 in Modules/ContentKit/Sources/Exercise/Exercice+MidiRecordingPlayer.swift

View workflow job for this annotation

GitHub Actions / swiftlint

Types should be nested at most 1 level deep (nesting)

Check warning on line 24 in Modules/ContentKit/Sources/Exercise/Exercice+MidiRecordingPlayer.swift

View workflow job for this annotation

GitHub Actions / swiftlint

Types should be nested at most 1 level deep (nesting)

Check warning on line 24 in Modules/ContentKit/Sources/Exercise/Exercice+MidiRecordingPlayer.swift

View workflow job for this annotation

GitHub Actions / swiftlint

Types should be nested at most 1 level deep (nesting)
case instructions
case instrument
case songs
}
}
}

// swiftlint:enable nesting

0 comments on commit 747809e

Please sign in to comment.