Ejemplo n.º 1
0
 public Bencodex.Types.Dictionary ToBencodex() =>
 new Bencodex.Types.Dictionary(new Dictionary <IKey, IValue>
 {
     [(Text)"used_weapons"] = new List(
         UsedWeapons.Select(x => (IValue)((Text)x))),
     [(Text)"targets"] = new List(Targets.Select(x => (IValue)((Text)x))),
 });
Ejemplo n.º 2
0
 public void GetObjectData(
     SerializationInfo info,
     StreamingContext context
     )
 {
     info.AddValue("used_weapons", UsedWeapons.ToArray());
     info.AddValue("targets", Targets.ToArray());
 }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((UsedWeapons?.GetHashCode() ?? 0) * 397) ^
                (Targets?.GetHashCode() ?? 0));
     }
 }
Ejemplo n.º 4
0
 public bool Equals(BattleResult other)
 {
     return(other != null &&
            UsedWeapons.SetEquals(other.UsedWeapons) &&
            Targets.SetEquals(other.Targets));
 }