Пример #1
0
        /* Generates new share for a player according to his/her old share (CurShare) and list of subshare (subshares) from other players */
        private static Share GenerateNewShare(Share CurShare, Field[] subshares)
        {
            if (subshares.Length == 0)
            {
                throw new System.ArgumentException("Array subshares cannot be empty", "subshares");
            }
            Field NewX = CurShare.GetX();
            Field NewY = CurShare.GetY();

            for (byte i = 0; i < subshares.Length; i++)
            {
                NewY += subshares[i];
            }
            Share NewShare = new Share(NewX, NewY);

            return(NewShare);
        }
Пример #2
0
 public Share(Share S)
 {
     t = new Tuple <Field, Field>(S.GetX(), S.GetY());
 }