/// <summary> /// Removes your blindfold for a person, provided you are waering one. /// </summary> /// <param name="them"></param> /// <returns></returns> public IStatus <Avatar> DoffBlindfoldFor(Avatar them) { var response = new Status <Avatar>(); try { response = IsBlindfolded(response); if (response.IsSuccess()) { response = LastCruise.DoffBlindfold(response, this, them); } if (response.IsSuccess()) { AddDomainEvent(new DoffedBlindfoldDomainEvent(this)); } } catch (Exception ex) { response.AddException(ex); } return(AvatarValidationStatus(response)); }
/// <summary> /// Recinds an excpetion granted to your hood. /// </summary> /// <param name="them"></param> /// <returns></returns> public IStatus <Avatar> ReDonHoodFor(Avatar them) { var response = new Status <Avatar>(); try { response = IsHooded(response); if (response.IsSuccess()) { response = LastCruise.DonHood(response, this, them); } if (response.IsSuccess()) { AddDomainEvent(new ReDonnedHoodDomainEvent(this, them)); } } catch (Exception ex) { response.AddException(ex); } return(AvatarValidationStatus(response)); }
/// <summary> /// Gets the currenly active cruise if there is one. /// </summary> private Cruise GetActiveCruise() { if (!HasLastCruise) { return(null); } if (LastCruise.HasTimeRemaining()) { return(LastCruise); } return(null); }
/// <summary> /// Extends time left in the last cruise session /// </summary> /// <returns></returns> public IStatus <Avatar> ExtendCruiseTime(TimeExtension extension) { var response = new Status <Avatar>(); try { LastCruise.ExtendTime(response, this, extension); } catch (Exception ex) { response.AddException(ex); } return(AvatarValidationStatus(response)); }
/// <summary> /// Can I see another Avatar's impression photo? /// </summary> /// <remarks> /// A number of factors can influance if another avatar can be seen. /// You could be wearing a blindfold. They could be excpempt from that /// blindfold. They could be wearing a hood preventing you from seeing /// them.</remarks> /// <param name="them">The avatar I am atempting to see</param> /// <returns></returns> public bool ICanSeeThem(Avatar them) { var areTheyExemptFromMyBlindfold = LastCruise.IsBlindfoldRemovedForAvatar (them); var amIExemptFromThierHood = them.LastCruise.IsHoodRemovedForAvatar (this); if (Blindfolded && !areTheyExemptFromMyBlindfold) { return(false); } if ((Blindfolded && areTheyExemptFromMyBlindfold) || !Blindfolded) { if (them.Hooded && !amIExemptFromThierHood) { return(false); } } // Does not meet any rules for not being seen. return(true); }