public static async Task <(bool result, Thing?who, Thing?what)> Controls(this Dbref whoDbref, Dbref whatDbref, CancellationToken cancellationToken) { var what = await whatDbref.Get(cancellationToken); var(result, who) = await what.IsControlledBy(whoDbref, cancellationToken); return(result, who, what); }
public static async Task <(string, Thing?)> UnparseObject(this Dbref dbref, Dbref player, CancellationToken cancellationToken) { var thing = await dbref.Get(cancellationToken); if (thing == null) { return("*INVALID*", null); } return(await thing.UnparseObject(player, cancellationToken), thing); }
public static async Task <(bool result, Thing?who)> IsControlledBy(this Thing?what, Dbref whoDbref, CancellationToken cancellationToken) { var who = await whoDbref.Get(cancellationToken); return(what.IsControlledBy(who), who); }