Ejemplo n.º 1
0
        public override float Calculate(Pawn observer, Pawn assessed)
        {
            //List<Pawn> allPawns = assessed.MapHeld.mapPawns.AllPawnsSpawned;
            float numOfAssessedFriends = 0f;
            float numOfObservedFriends = 0f;

            /*
             * if (cachedValues)
             * {
             *  numOfAssessedFriends = GRHelper.GRPawnComp(assessedPawn).cachedNumberOfColonyFriends;
             *  numOfObservedFriends = GRHelper.GRPawnComp(observerPawn).cachedNumberOfColonyFriends;
             * }
             */
            numOfAssessedFriends = RelationshipUtility.NumberOfFriends(assessed);
            numOfObservedFriends = RelationshipUtility.NumberOfFriends(observer);

            float friendDifference = numOfAssessedFriends - numOfObservedFriends;

            if (friendDifference == 0f)
            {
                return(1f);
            }
            return(Mathf.Pow(((numOfAssessedFriends + 1f) / (numOfObservedFriends + 1f)), FriendAttractionDampener));
        }