View Javadoc
1   /*
2    * Copyright (c) 2022 Kaiserpfalz EDV-Service, Roland T. Lichti.
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16   */
17  
18  package de.kaiserpfalzedv.rpg.torg.model.perks;
19  
20  import com.fasterxml.jackson.annotation.JsonInclude;
21  import de.kaiserpfalzedv.rpg.torg.model.actors.Clearance;
22  import de.kaiserpfalzedv.rpg.torg.model.core.Armor;
23  import de.kaiserpfalzedv.rpg.torg.model.core.Attack;
24  import de.kaiserpfalzedv.rpg.torg.model.core.Cosm;
25  import lombok.AllArgsConstructor;
26  import lombok.EqualsAndHashCode;
27  import lombok.Getter;
28  import lombok.ToString;
29  import lombok.experimental.SuperBuilder;
30  import lombok.extern.jackson.Jacksonized;
31  import org.eclipse.microprofile.openapi.annotations.media.Schema;
32  
33  import jakarta.validation.constraints.Size;
34  import java.io.Serializable;
35  import java.util.Set;
36  
37  /**
38   * PerkData -- A generic perk.
39   * <p>
40   * Most perks offer multiple powers. These will be of different types.
41   *
42   * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
43   * @since 1.2.0  2021-05-23
44   */
45  @Jacksonized
46  @SuperBuilder(toBuilder = true)
47  @AllArgsConstructor
48  @Getter
49  @ToString(onlyExplicitlyIncluded = true)
50  @EqualsAndHashCode
51  @JsonInclude(JsonInclude.Include.NON_ABSENT)
52  @Schema(description = "The perk definition.")
53  public class PerkData implements Serializable {
54      @Size(max = 5000, message = "The textual description must not be larger than 5000 characters.")
55      @Schema(description = "A textual description of this spell.", nullable = true, maxLength = 5000)
56      private final String description;
57  
58      @ToString.Include
59      @EqualsAndHashCode.Include
60      @Schema(description = "Sub category of this perk")
61      private final String subCategory;
62  
63      @ToString.Include
64      @EqualsAndHashCode.Include
65      @Schema(description = "The minimum clearance level for this spell.")
66      private final Clearance clearance;
67  
68      @Schema(description = "The cosms this perk is available for.", minItems = 0)
69      private final Set<Cosm> cosms;
70  
71      @Schema(description = "Notes to this spell.", minItems = 0)
72      private final Set<String> notes;
73  
74      @Schema(description = "Infos to this spell.", minItems = 0)
75      private final Set<String> info;
76  
77      @Schema(description = "Prerequisites for obtaining the spell", minItems = 0)
78      private final Set<Prerequisites> prerequisites;
79  
80      @Schema(description = "Possible attack (most spells are treated as attack to use the CharSheet for rolling).", minItems = 0)
81      private final Set<Attack> attack;
82  
83      @Schema(description = "Possible armor (some spells provide armor depending on success levels).", minItems = 0)
84      private final Set<Armor> armor;
85  }