コード例 #1
0
        public override int GetHashCode()
        {
            var firstHash  = CoordX.GetHashCode() + CoordY.GetHashCode();
            var secondHash = Parent.GetHashCode() + Distance.GetHashCode();

            return((firstHash + secondHash) * secondHash + firstHash);
        }
コード例 #2
0
ファイル: PokemonOutward.cs プロジェクト: gyyfifafans/PBO
        /// <summary>
        /// PokemonOutward是可以序列化的,主机端不要调用这些方法
        /// </summary>
        public void ChangePosition(int x, CoordY y)
        {
            if (Position.X == x && Position.Y == y)
            {
                return;
            }
            _position.X = x;
            _position.Y = y;
#if TEST
            if (listener != null)
#endif
            listener.PositionChanged();
        }
コード例 #3
0
        public override int GetHashCode()
        {
            var hashCode = 892106565;

            hashCode = hashCode * -1521134295 + CoordX.GetHashCode();
            hashCode = hashCode * -1521134295 + CoordY.GetHashCode();
            hashCode = hashCode * -1521134295 + ParamA.GetHashCode();
            hashCode = hashCode * -1521134295 + ParamB.GetHashCode();
            hashCode = hashCode * -1521134295 + ParamC.GetHashCode();
            hashCode = hashCode * -1521134295 + Distance.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <List <double> > .Default.GetHashCode(Traits);

            return(hashCode);
        }
コード例 #4
0
        public override string ToString()
        {
            string result = "";

            result += " CoordX: " + CoordX.ToString();
            result += " CoordY: " + CoordY.ToString();
            result += " ParamA: " + ParamA.ToString();
            result += " ParamB: " + ParamB.ToString();
            result += " ParamC: " + ParamC.ToString();

            result += "\nTraits: ";
            for (int i = 0; i < Traits.Count; i++)
            {
                result += Traits[i].ToString() + " | ";
            }
            result += "\nDistance to neighbour: " + Distance.ToString();

            return(result);
        }
コード例 #5
0
ファイル: Position.cs プロジェクト: sunoru/PBO
 public Position(int team, int x, CoordY y = CoordY.Plate)
 {
     Team = team;
       X = x;
       Y = y;
 }
コード例 #6
0
ファイル: Position.cs プロジェクト: gyyfifafans/PBO
 public Position(int team, int x, CoordY y = CoordY.Plate)
 {
     Team = team;
     X    = x;
     Y    = y;
 }