示例#1
0
 public override bool Equals(object other)
 {
     if (other.GetType() == typeof(MZEdge))
     {
         MZEdge o = (MZEdge)other;
         return(targetRoomId == o.targetRoomId &&
                (Symbol == o.Symbol || Symbol.Equals(o.Symbol)));
     }
     else
     {
         return(base.Equals(other));
     }
 }
示例#2
0
    public MZEdge SetEdge(int targetRoomId, MZSymbol symbol)
    {
        MZEdge e = GetEdge(targetRoomId);

        if (e != null)
        {
            e.Symbol = symbol;
        }
        else
        {
            e = new MZEdge(targetRoomId, symbol);
            edges.Add(e);
        }
        return(e);
    }