-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
β¨ (RobotKit): Add first (empty) implementation of Robot class
This commit defines the public interface of the Robot class Methods don't do anything except from printing to the console. Detailed implementation will follow
- Loading branch information
Showing
4 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright 2023 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// swiftlint:disable identifier_name | ||
|
||
extension Robot { | ||
|
||
public enum Lights { | ||
case full | ||
case halfLeft | ||
case halfRight | ||
case quarterFrontLeft | ||
case quarterFrontRight | ||
case quarterBackLeft | ||
case quarterBackRight | ||
|
||
case range(start: Int, end: Int) | ||
case spot(ids: [Int]) | ||
|
||
} | ||
|
||
public struct Color { | ||
|
||
public var data: [UInt8] | ||
|
||
public var red: UInt8 { | ||
data[0] | ||
} | ||
|
||
public var green: UInt8 { | ||
data[1] | ||
} | ||
|
||
public var blue: UInt8 { | ||
data[2] | ||
} | ||
|
||
// TODO(@hugo): Add all colors decided w/ Lucie, Hortense | ||
Check failure on line 39 in Modules/RobotKit/Sources/Robot+Lights.swift GitHub Actions / lint
|
||
public static let red: Color = Color(data: [255, 0, 0]) | ||
public static let green: Color = Color(data: [0, 255, 0]) | ||
public static let blue: Color = Color(data: [0, 0, 255]) | ||
|
||
} | ||
|
||
} | ||
|
||
// swiftlint:enable identifier_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright 2023 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
extension Robot { | ||
|
||
public enum Direction { | ||
case forward | ||
case forwardLeft | ||
case forwardRight | ||
case backward | ||
case backwardLeft | ||
case backwardRight | ||
} | ||
|
||
public enum Rotation { | ||
case clockwise | ||
case counterclockwise | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright 2023 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
extension Robot { | ||
|
||
public enum Reinforcer { | ||
case spinBlinkGreenOff | ||
case spinBlinkBlueViolet | ||
case fire | ||
case sprinkles | ||
case rainbow | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters