Merge pull request #843 from Dhina17/dev

wiki: fix code in ability extension example
This commit is contained in:
Ruben Bermudez 2021-03-06 11:15:27 +00:00 committed by GitHub
commit 4ae315eb09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
You have around 100 abilities in your bot and you're looking for a way to refactor that mess into more modular classes. `AbillityExtension` is here to support just that! It's not a secret that AbilityBot uses refactoring backstage to be able to construct all of your abilities and map them accordingly. However, AbilityBot searches initially for all methods that return an `AbilityExtension` type. Then, those extensions will be used to search for declared abilities. Here's an example.
```java
public class MrGoodGuy implements AbilityExtension {
public Ability () {
public Ability nice() {
return Ability.builder()
.name("nice")
.privacy(PUBLIC)
@ -13,7 +13,7 @@ public class MrGoodGuy implements AbilityExtension {
}
public class MrBadGuy implements AbilityExtension {
public Ability () {
public Ability notnice() {
return Ability.builder()
.name("notnice")
.privacy(PUBLIC)
@ -51,4 +51,4 @@ It's also possible to add extensions in the constructor by using the `addExtensi
// Override creatorId
}
```
```