Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }