示例#1
0
 //----------------------------------------------------------------------------------------------------
 /// <summary>
 /// 権限のないプレイヤーになる
 /// </summary>
 public void BecomeUnauthorizedPlayer()
 {
     //親設定と不要なものを取り除く
     Players          = GameObject.Find("Game").GetComponent <MyGame>().PlayersScript;
     transform.parent = Players.transform;
     Rb.isKinematic   = true;
     enabled          = false;
 }
示例#2
0
        public override int GetHashCode()
        {
            int hashCode = (int)(
                Math.Pow((double)MyPlayers.Count(), 2) + Math.Pow((double)TheirPlayers.Count(), 2) +
                Math.Pow((double)MyDifferential, 2) + Math.Pow((double)TheirDifferential, 2) +
                Math.Pow((double)CompositeDifferential, 2) + Math.Pow((double)Fairness, 2) +
                Math.Pow((double)MyPlayers.Sum(p => p.FantasyPoints), 2) + Math.Pow((double)TheirPlayers.Sum(p => p.FantasyPoints), 2)
                );

            return(hashCode);
        }
示例#3
0
        public bool Equals(Trade other)
        {
            if (MyPlayers.Count() != other.MyPlayers.Count())
            {
                return(false);
            }
            if (TheirPlayers.Count() != other.TheirPlayers.Count())
            {
                return(false);
            }

            List <int> myPlayerIds      = new List <int>();
            List <int> myOtherPlayerIds = new List <int>();

            foreach (Player player in MyPlayers)
            {
                myPlayerIds.Add(player.Id);
            }
            foreach (Player player in other.MyPlayers)
            {
                myOtherPlayerIds.Add(player.Id);
            }

            for (int i = 0; i < myPlayerIds.Count(); i++)
            {
                if (myPlayerIds[i] != myOtherPlayerIds[i])
                {
                    return(false);
                }
            }

            List <int> theirPlayerIds      = new List <int>();
            List <int> theirOtherPlayerIds = new List <int>();

            foreach (Player player in TheirPlayers)
            {
                theirPlayerIds.Add(player.Id);
            }
            foreach (Player player in other.TheirPlayers)
            {
                theirOtherPlayerIds.Add(player.Id);
            }

            for (int i = 0; i < theirPlayerIds.Count(); i++)
            {
                if (theirPlayerIds[i] != theirOtherPlayerIds[i])
                {
                    return(false);
                }
            }

            return(true);
        }
示例#4
0
    //----------------------------------------------------------------------------------------------------
    /// <summary>
    /// インスタンスを探す
    /// </summary>
    void SearchInstance()
    {
        //親なし
        if (!transform.parent)
        {
            transform.parent = GameObject.Find("Game").GetComponent <MyGame>().PlayersScript.transform;
        }

        //親クラスなし
        Players = transform.parent.GetComponent <MyPlayers>();
        if (!Players)
        {
            return;
        }

        //不足インスタンスの設定
        m_camera = Players.GameScript.OperatingCameraScript;
    }