| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Linq; |
| | | 4 | | using System.Threading.Tasks; |
| | | 5 | | |
| | | 6 | | namespace MUNity.Database.Models.Simulation; |
| | | 7 | | |
| | | 8 | | public class SimSimInfo |
| | | 9 | | { |
| | 0 | 10 | | public int SimSimId { get; internal set; } |
| | | 11 | | |
| | 0 | 12 | | public string Name { get; internal set; } |
| | | 13 | | |
| | 0 | 14 | | public int UserCount { get; internal set; } |
| | | 15 | | |
| | 0 | 16 | | public bool UsesPassword { get; internal set; } |
| | | 17 | | |
| | | 18 | | public static explicit operator SimSimInfo(Simulation f) |
| | 0 | 19 | | { |
| | 0 | 20 | | return new SimSimInfo(f); |
| | 0 | 21 | | } |
| | | 22 | | |
| | | 23 | | //public static implicit operator SimSimInfo(Simulation f) |
| | | 24 | | //{ |
| | | 25 | | // return new SimSimInfo(f); |
| | | 26 | | //} |
| | | 27 | | |
| | 0 | 28 | | public SimSimInfo(Simulation model) |
| | 0 | 29 | | { |
| | 0 | 30 | | this.SimSimId = model.SimulationId; |
| | 0 | 31 | | this.Name = model.Name; |
| | 0 | 32 | | this.UsesPassword = !string.IsNullOrEmpty(model.Password); |
| | 0 | 33 | | this.UserCount = model.Users.Count; |
| | 0 | 34 | | } |
| | | 35 | | } |