-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathIPalRefLocation.cs
46 lines (37 loc) · 1.26 KB
/
IPalRefLocation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using PalCalc.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PalCalc.Solver
{
public interface IPalRefLocation { }
public class OwnedRefLocation : IPalRefLocation
{
public string OwnerId { get; set; }
public PalLocation Location { get; set; }
public override string ToString() => Location.ToString();
}
public class CapturedRefLocation : IPalRefLocation
{
public override string ToString() => "(Wild)";
public static IPalRefLocation Instance { get; } = new CapturedRefLocation();
}
public class BredRefLocation : IPalRefLocation
{
public override string ToString() => "(Bred)";
public static IPalRefLocation Instance { get; } = new BredRefLocation();
}
public class CompositeRefLocation : IPalRefLocation
{
public CompositeRefLocation(IPalRefLocation maleLoc, IPalRefLocation femaleLoc)
{
MaleLoc = maleLoc;
FemaleLoc = femaleLoc;
}
public IPalRefLocation MaleLoc { get; }
public IPalRefLocation FemaleLoc { get; }
public override string ToString() => $"Either {MaleLoc} (male) or {FemaleLoc} (female)";
}
}