Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((A?.GetHashCode() ?? 0) ^ (B?.GetHashCode() ?? 0));
     }
 }
Exemplo n.º 2
0
        internal static IMailbox ActorMailbox(
            Stage stage,
            IAddress address,
            Definition definition)
        {
            var mailboxName = stage.World.MailboxNameFrom(definition.MailboxName);
            var mailbox     = stage.World.AssignMailbox(mailboxName, address.GetHashCode());

            return(mailbox);
        }
Exemplo n.º 3
0
        internal static IMailbox ActorMailbox(
            Stage stage,
            IAddress?address,
            Definition definition,
            IMailboxWrapper wrapper)
        {
            var mailboxName = stage.World.MailboxNameFrom(definition.MailboxName);
            var mailbox     = stage.World.AssignMailbox(mailboxName, address?.GetHashCode());

            return(wrapper.Wrap(address, mailbox));
        }
Exemplo n.º 4
0
 private int MapIndex(IAddress address) => Math.Abs(address.GetHashCode() % maps.Length);
Exemplo n.º 5
0
 public static TimeSpan AdjustForNode(this TimeSpan timeSpan, IAddress nodeAddress)
 {
     return(timeSpan + TimeSpan.FromTicks((long)(timeSpan.Ticks * new Random(nodeAddress.GetHashCode()).NextDouble())));
 }