-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new 'avatar' and 'chess' data providers
- Loading branch information
Showing
12 changed files
with
302 additions
and
2 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
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
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
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
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
26 changes: 26 additions & 0 deletions
26
core/src/main/kotlin/io/github/serpro69/kfaker/provider/Avatar.kt
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,26 @@ | ||
@file:Suppress("unused") | ||
|
||
package io.github.serpro69.kfaker.provider | ||
|
||
import io.github.serpro69.kfaker.* | ||
import io.github.serpro69.kfaker.dictionary.* | ||
import io.github.serpro69.kfaker.provider.unique.LocalUniqueDataProvider | ||
import io.github.serpro69.kfaker.provider.unique.UniqueProviderDelegate | ||
|
||
/** | ||
* [FakeDataProvider] implementation for [YamlCategory.AVATAR] | ||
*/ | ||
class Avatar internal constructor(fakerService: FakerService) : YamlFakeDataProvider<Avatar>(fakerService) { | ||
override val yamlCategory = YamlCategory.AVATAR | ||
override val localUniqueDataProvider = LocalUniqueDataProvider<Avatar>() | ||
override val unique by UniqueProviderDelegate(localUniqueDataProvider) | ||
|
||
init { | ||
fakerService.load(yamlCategory) | ||
} | ||
|
||
fun characters() = resolve("characters") | ||
fun dates() = resolve("dates") | ||
fun quotes() = resolve("quotes") | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
core/src/main/kotlin/io/github/serpro69/kfaker/provider/Chess.kt
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,25 @@ | ||
package io.github.serpro69.kfaker.provider | ||
|
||
import io.github.serpro69.kfaker.* | ||
import io.github.serpro69.kfaker.dictionary.* | ||
import io.github.serpro69.kfaker.provider.unique.LocalUniqueDataProvider | ||
import io.github.serpro69.kfaker.provider.unique.UniqueProviderDelegate | ||
|
||
/** | ||
* [FakeDataProvider] implementation for [YamlCategory.CHESS] category. | ||
*/ | ||
@Suppress("unused") | ||
class Chess internal constructor(fakerService: FakerService) : YamlFakeDataProvider<Chess>(fakerService) { | ||
override val yamlCategory = YamlCategory.CHESS | ||
override val localUniqueDataProvider = LocalUniqueDataProvider<Chess>() | ||
override val unique by UniqueProviderDelegate(localUniqueDataProvider) | ||
|
||
init { | ||
fakerService.load(yamlCategory) | ||
} | ||
|
||
fun players() = resolve("players") | ||
fun tournaments() = resolve("tournaments") | ||
fun openings() = resolve("openings") | ||
fun titles() = resolve("titles") | ||
} |
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
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,33 @@ | ||
# START avatar_provider_dict | ||
en: | ||
faker: | ||
avatar: | ||
characters: ['Neytiri', 'Jake Sully, Tommy', 'Doctora Grace Augustine', 'Ronal', 'Trudy Chacon', 'Miles Quaritch', 'Dr. Karina Mogue', 'Parker Selfridge', 'Mo at', 'Eytukan', 'Dragon Gunship Pilot', 'Neteyam', 'Varang', 'Otamu', 'Bilano', 'Deyshana', 'Entok', 'Eywaftia', 'Frapohu', 'Ronal', 'Saeyla', 'Sevineyo', 'Ian Garvin', 'Hukato'] | ||
dates: ['December 18, 2009', 'December 15, 2022', 'December 20, 2024'] | ||
quotes: [ | ||
"I'm a warrior of the Jarhead clan.", | ||
"I was a warrior who dreamed he could bring peace. Sooner or later though, you always have to wake up.", | ||
"You want a fair deal, you're on the wrong planet. The strong prey on the weak.", | ||
"Sometimes your whole life boils down to one insane move.", | ||
"The Sky People have sent us a message: that they can take whatever they want. That no one can stop them. Well, we will send them a message: that they cannot take whatever they want! And that this...this is our land!", | ||
"All I ever wanted was a single thing worth fighting for.", | ||
"You don't choose your Avatar... your Avatar chooses you.", | ||
"The Na'vi say, that every person is born twice. The second time, is when you earn your place among the people...forever.", | ||
"Your spirit goes with Eywa. Your body stays behind to become part of The People.", | ||
"If it ain't raining, we ain't training.", | ||
"I became a Marine for the hardship. To be hammered on the anvil of life. I told myself I could pass any test a man can pass.", | ||
"If Grace is there with you - look in her memories - she can show you the world we come from. There's no green there. They killed their mother, and they're gonna do the same here.", | ||
"Sooner or later, though, you always have to wake up.", | ||
"Everything is backwards now, like out there is the true world, and in here is the dream.", | ||
"I'm with you now, Jake. We are mated for life.", | ||
"To become 'taronyu' hunter, you must choose your own Ikran and he must choose you.", | ||
"Toruk chose him, it has only happened five times since the time of first songs.", | ||
"You have a strong heart. No fear. But stupid! Ignorant like a child!", | ||
"Our great mother does not take sides, Jake; she protects the balance of life.", | ||
"Hey Sully... how does it feel to betray your own race? You think you're one of them? Time to wake up!", | ||
"Everyone on this base, every one of you, is fighting for survival, and that's a fact.", | ||
"And when we destroy it, we will blast a crater in their racial memory so deep, that they won't come within 1,000 klicks of this place ever again. And that too, is a fact.", | ||
"So you just figured you'd come here, to the most hostile environment known to men, with no training of any kind, and see how it went? What was going through your head?", | ||
"It is hard to fill a cup that is already full." | ||
] | ||
# END avatar_provider_dict |
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,105 @@ | ||
# START chess_provider_dict | ||
en: | ||
faker: | ||
chess: | ||
players: | ||
- Alexander Alekhine | ||
- Alexei Shirov | ||
- Alexis Vargas | ||
- Anatoly Karpov | ||
- Bobby Fischer | ||
- Emanuel Lasker | ||
- Fabiano Caruana | ||
- Garry Kasparov | ||
- Hikaru Nakamura | ||
- Jose Raul Capablanca | ||
- Levon Aronian | ||
- Magnus Carlsen | ||
- Mikhail Botvinnik | ||
- Radjabov Teimour | ||
- Sergey Karjakin | ||
- Tigran Petrosian | ||
- Viswanathan Anand | ||
- Vladimir Kramnik | ||
- Wesley So | ||
- Paul Morphy | ||
tournaments: | ||
- Wijk aan Zee | ||
- Linares | ||
- Astrakhan | ||
- Dortmund | ||
- Shanghai | ||
- Bilbao | ||
- Nanjing | ||
- Moscow | ||
- London | ||
- Moscow | ||
- Tromsø (Chess World Cup) | ||
- Paris (Grand Prix 2012–2013) | ||
- Bucharest | ||
- Nizhny Novgorod (Russian Championship) | ||
- Zurich | ||
- Khanty-Mansisyk (Candidates Tournament) | ||
- Tbilisi (Grand Prix 2014–2015) | ||
- Khanty-Mansisyk (Grand Prix 2014–2015) | ||
- Baku (Chess World Cup) | ||
- London (Grand Chess Tour) | ||
- Gibraltar | ||
openings: | ||
- Alekhine’s Defense | ||
- Benko Gambit | ||
- Benoni Defense | ||
- Bird’s Opening | ||
- Bogo-Indian Defense | ||
- Budapest Gambit | ||
- Catalan Opening | ||
- Caro-Kann Defense | ||
- Colle System | ||
- Dutch Defense | ||
- Giuoco Piano | ||
- English Opening | ||
- Evans Gambit | ||
- Four Knights Game | ||
- French Defense | ||
- Grünfeld Defense | ||
- Italian Game | ||
- King’s Gambit | ||
- King’s Indian Attack | ||
- King’s Indian Defense | ||
- King’s Pawn Game | ||
- London System | ||
- Modern Defense | ||
- Nimzo-Indian Defense | ||
- Nimzowitsch Defense | ||
- Petrov’s Defense | ||
- Philidor’s Defense | ||
- Pirc Defense | ||
- Queen’s Pawn Game | ||
- Queen’s Gambit Accepted | ||
- Queen’s Gambit Declined | ||
- Queen’s Indian Defense | ||
- Réti Opening | ||
- Ruy Lopez | ||
- Scandinavian Defense | ||
- Scotch Game | ||
- Sicilian Defense | ||
- Slav Defense | ||
- Torre Attack | ||
- Two Knights Defense | ||
- Vienna Game | ||
- Wade Defense | ||
titles: | ||
- GM | ||
- IM | ||
- FM | ||
- CM | ||
- WGM | ||
- WIM | ||
- WFM | ||
- WCM | ||
- AGM | ||
- AIM | ||
- AFM | ||
- ACM | ||
|
||
# END chess_provider_dict |
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,26 @@ | ||
--- | ||
--- | ||
|
||
== `Faker().avatar` | ||
|
||
.Dictionary file | ||
[%collapsible] | ||
==== | ||
[source,yaml] | ||
---- | ||
{% snippet 'avatar_provider_dict' %} | ||
---- | ||
==== | ||
|
||
.Available Functions | ||
[%collapsible] | ||
==== | ||
[source,kotlin] | ||
---- | ||
Faker().avatar.characters() // => Neytiri | ||
Faker().avatar.dates() // => December 18, 2009 | ||
Faker().avatar.quotes() // => I'm a warrior of the Jarhead clan. | ||
---- | ||
==== |
Oops, something went wrong.