GitHub PullRequestReviewCommentEvent at 2014-01-06 22:36:47
Repository: IStrategizer
Actor: ogail
Payload: {"comment":{"url":"https://api.github.com/repos/ogail/IStrategizer/pulls/comments/8680194","id":8680194,"diff_hunk":"@@ -28,41 +28,34 @@\n     public:\n         AdapterEx();\n         MapArea AdaptPositionForBuilding(EntityClassType p_buildingType);\n-        TID AdaptWorkerForBuild();\n         TID AdaptBuildingForTraining(EntityClassType p_traineeType);\n         TID AdaptBuildingForResearch(ResearchType p_researchType);\n-        TID AdaptAttacker(EntityClassType p_attackerType);\n-        TID AdaptEntityToMove(EntityClassType p_EntityType);\n         TID AdaptTargetEntity(EntityClassType p_targetType, const PlanStepParameters& p_parameters);\n+        TID GetEntityObjectId(EntityClassType p_entityType,const vector<ObjectStateType>& p_rankedStates);\n+        TID GetEntityObjectId(EntityClassType p_entityType);\n         Vector2 AdaptPosition(const PlanStepParameters& p_parameters);\n \n+        static vector<ObjectStateType> WorkerStatesRankVector;\n+        static vector<ObjectStateType> AttackerStatesRankVector;\n+        static vector<ObjectStateType> EntityToMoveStatesRankVector;\n+\n     private:\n         Vector2 GetBotColonyCenter();\n-\n-        static bool IsValidWorkerState(ObjectStateType p_workerState);\n-        static unsigned GetWorkerStateIndex(ObjectStateType p_workerState);\n-        static bool WorkerStatesComparer(pair<TID, ObjectStateType> &p_leftWorker, pair<TID, ObjectStateType> &p_rightWorker);\n-\n-        static bool IsValidAttackerState(ObjectStateType p_attackerState);\n-        static unsigned GetAttackerStateIndex(ObjectStateType p_attackerState);\n-        static bool AttackerStatesComparer(pair<TID, ObjectStateType> &p_leftAttacker, pair<TID, ObjectStateType> &p_rightAttacker);\n-\n-        static bool IsValidEntityToMoveState(ObjectStateType p_entityState);\n-        static unsigned GetEntityToMoveStateIndex(ObjectStateType p_entityState);\n+        static void initializePredefinedRankedStates();\n         static bool EntityToMoveStatesComparer(pair<TID, ObjectStateType> &p_leftAttacker, pair<TID, ObjectStateType> &p_rightAttacker);\n \n+        static bool IsValidEntityState(ObjectStateType p_entityState,const vector<ObjectStateType>& p_rankedStates);\n+        static int GetEntityStateIndex(ObjectStateType p_entityState,const vector<ObjectStateType>& p_rankedStates);\n+\n         static bool BuildPositionSearchPredicate(unsigned p_cellX, unsigned p_cellY, const TCell* p_pCell, void *p_pParam);\n \n-        const static unsigned WorkerStatesSize;\n-        const static ObjectStateType WorkerStatesRank[];\n-        const static unsigned AttackerStatesSize;\n-        const static ObjectStateType AttackerStatesRank[];\n-        const static unsigned EntityToMoveStatesSize;\n-        const static ObjectStateType EntityToMoveStatesRank[];\n-        const static int DefaultBuildingSpacing;\n+        const static int                DefaultBuildingSpacing;\n+        static bool                     IsRankedStatesInitialized;\n+\n \n         Vector2 m_botColonyCenter;\n-        int m_buildingSpacing;\n+        int        m_buildingSpacing;","path":"Include/IStrategizer/AdapterEx.h","position":52,"original_position":52,"commit_id":"f82d0c2bc3580f77e25ecb11efc59869c962d7f6","original_commit_id":"f82d0c2bc3580f77e25ecb11efc59869c962d7f6","user":{"login":"ogail","id":1034045,"avatar_url":"https://gravatar.com/avatar/845e2279db97207146d9a29a8223e939?d=https%3A%2F%2Fidenticons.github.com%2Fb96b494e021dc3a569941c5487d51e0c.png&r=x","gravatar_id":"845e2279db97207146d9a29a8223e939","url":"https://api.github.com/users/ogail","html_url":"https://github.com/ogail","followers_url":"https://api.github.com/users/ogail/followers","following_url":"https://api.github.com/users/ogail/following{/other_user}","gists_url":"https://api.github.com/users/ogail/gists{/gist_id}","starred_url":"https://api.github.com/users/ogail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogail/subscriptions","organizations_url":"https://api.github.com/users/ogail/orgs","repos_url":"https://api.github.com/users/ogail/repos","events_url":"https://api.github.com/users/ogail/events{/privacy}","received_events_url":"https://api.github.com/users/ogail/received_events","type":"User","site_admin":false},"body":"Make sure that all your code has proper spacing","created_at":"2014-01-06T22:36:47Z","updated_at":"2014-01-06T22:36:47Z","html_url":"https://github.com/ogail/IStrategizer/pull/4#discussion_r8680194","pull_request_url":"https://api.github.com/repos/ogail/IStrategizer/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/ogail/IStrategizer/pulls/comments/8680194"},"html":{"href":"https://github.com/ogail/IStrategizer/pull/4#discussion_r8680194"},"pull_request":{"href":"https://api.github.com/repos/ogail/IStrategizer/pulls/4"}}}}