-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from AWSary/game
new game, guess aws service name
- Loading branch information
Showing
2 changed files
with
46 additions
and
5 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 |
---|---|---|
|
@@ -10,13 +10,22 @@ import Foundation | |
var fm = FileManager.default | ||
var subUrl: URL? | ||
var mainUrl: URL? = Bundle.main.url(forResource: "aws_services", withExtension: "json") | ||
var lastRandom: awsService = awsService(id: 10, name: "DeepRacer", longName: "AWS DeepRacer", shortDesctiption: "DeepRacer", imageURL: "https://static.tig.pt/awsary/logos/[email protected]", youtube_id: "") | ||
|
||
class AwsServices: ObservableObject { | ||
@Published var services = [awsService]() | ||
|
||
|
||
func getNameOfLastRandom() -> String { | ||
return lastRandom.longName | ||
} | ||
|
||
func getLastRandom() -> awsService { | ||
return lastRandom | ||
} | ||
|
||
func getRandomElement() -> awsService{ | ||
return services.randomElement()! | ||
lastRandom = services.randomElement()! | ||
return lastRandom | ||
} | ||
init() { | ||
refresh() | ||
|
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