| | 1 | | using MUNity.Base; |
| | 2 | | using System; |
| | 3 | | using System.Collections.Generic; |
| | 4 | | using System.ComponentModel.DataAnnotations; |
| | 5 | | using System.Linq; |
| | 6 | | using System.Text.Json.Serialization; |
| | 7 | | using System.Threading.Tasks; |
| | 8 | |
|
| | 9 | | namespace MUNity.Database.Models.Simulation; |
| | 10 | |
|
| | 11 | | public class SimulationRole |
| | 12 | | { |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// The Id for this SimulationRole. |
| | 16 | | /// </summary> |
| 0 | 17 | | public int SimulationRoleId { get; set; } |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// The name of the Role for example Delegate of Germany. |
| | 21 | | /// </summary> |
| | 22 | | [MaxLength(250)] |
| 0 | 23 | | public string Name { get; set; } |
| | 24 | |
|
| 0 | 25 | | public RoleTypes RoleType { get; set; } |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// The iso of this role. For example DE for Germany or UK for United Kingdom. |
| | 29 | | /// Read all about the Alpha-2 codes here: |
| | 30 | | /// https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes |
| | 31 | | /// </summary> |
| | 32 | | [MaxLength(5)] |
| 0 | 33 | | public string Iso { get; set; } |
| | 34 | |
|
| 0 | 35 | | public Simulation Simulation { get; set; } |
| | 36 | |
|
| 0 | 37 | | public SimulationRole() |
| 0 | 38 | | { |
| | 39 | |
|
| 0 | 40 | | } |
| | 41 | |
|
| 0 | 42 | | public SimulationRole(string iso, string name, RoleTypes roleType) |
| 0 | 43 | | { |
| 0 | 44 | | this.Iso = iso; |
| 0 | 45 | | this.Name = name; |
| 0 | 46 | | this.RoleType = roleType; |
| 0 | 47 | | } |
| | 48 | |
|
| | 49 | | public bool IsDelegateOrNgo() |
| 0 | 50 | | { |
| 0 | 51 | | return this.RoleType == RoleTypes.Delegate || this.RoleType == RoleTypes.Ngo; |
| 0 | 52 | | } |
| | 53 | | } |