Instructions Jenkins Doxygen

[Updated] documentation of functions in the lua jedi managers. 62/862/1
authorLoshult <loshult@swgemu.com>
Mon, 30 Sep 2013 09:27:58 +0000 (09:27 +0000)
committerLoshult <loshult@swgemu.com>
Mon, 30 Sep 2013 09:27:58 +0000 (09:27 +0000)
[Changed] name of a few functions in the jedi manager.

Change-Id: I1ab398c638727f67419d4147dfcfb9fc6ab198c9

MMOCoreORB/bin/scripts/managers/holocron_jedi_manager.lua
MMOCoreORB/bin/scripts/managers/jedi_manager.lua
MMOCoreORB/bin/scripts/managers/tests/holocron_jedi_manager_Test.lua
MMOCoreORB/src/server/zone/managers/jedi/JediManager.cpp
MMOCoreORB/src/server/zone/managers/jedi/JediManager.h
MMOCoreORB/src/server/zone/managers/player/creation/PlayerCreationManager.cpp
MMOCoreORB/src/server/zone/objects/player/PlayerObjectImplementation.cpp

index 033702a..afac592 100644 (file)
@@ -11,6 +11,8 @@ HolocronJediManager = JediManager:new {
        startingEvent = nil,
 }
 
+-- Return a list of all professions and their badge number that are available for the hologrind
+-- @return a list of professions and their badge numbers.
 function HolocronJediManager:getGrindableProfessionList()
        local grindableProfessions = {
                -- String Id, badge number, profession name
@@ -61,7 +63,10 @@ function HolocronJediManager:getGrindableProfessionList()
        return grindableProfessions
 end
 
-function HolocronJediManager:onPlayerCreation(pCreatureObject)
+-- Handling of the onPlayerCreated event.
+-- Hologrind professions will be generated for the player.
+-- @param pCreatureObject pointer to the creature object of the created player.
+function HolocronJediManager:onPlayerCreated(pCreatureObject)
        local skillList = HolocronJediManager.getGrindableProfessionList()
        HolocronJediManager.withCreaturePlayerObject(pCreatureObject, function(playerObject)
                for i = 1, NUMBEROFPROFESSIONSTOMASTER, 1 do
@@ -73,6 +78,9 @@ function HolocronJediManager:onPlayerCreation(pCreatureObject)
        end)
 end
 
+-- Check and count the number of mastered hologrind professions.
+-- @param pCreatureObject pointer to the creature object of the player which should get its number of mastered professions counted.
+-- @return the number of mastered hologrind professions.
 function HolocronJediManager.getNumberOfMasteredProfessions(pCreatureObject)
        return HolocronJediManager.withCreaturePlayerObject(pCreatureObject, function(playerObject)
                local professions = playerObject:getHologrindProfessions()
@@ -86,6 +94,8 @@ function HolocronJediManager.getNumberOfMasteredProfessions(pCreatureObject)
        end)
 end
 
+-- Check if the player has mastered all hologrind professions and give the player jedi status in that case.
+-- @param pCreatureObject pointer to the creature object of the player to check the jedi progression on.
 function HolocronJediManager.checkIfProgressedToJedi(pCreatureObject)
        if HolocronJediManager.getNumberOfMasteredProfessions(pCreatureObject) >= NUMBEROFPROFESSIONSTOMASTER then
                HolocronJediManager.withCreatureObject(pCreatureObject, function(creatureObject)
@@ -94,15 +104,22 @@ function HolocronJediManager.checkIfProgressedToJedi(pCreatureObject)
        end
 end
 
+-- Register observer on the player for observing badge awards.
+-- @param pCreatureObject pointer to the creature object of the player to register observers on.
 function HolocronJediManager.registerObservers(pCreatureObject)
 
 end
 
-function HolocronJediManager:onPlayerLogin(pCreatureObject)
+-- Handling of the onPlayerLoggedIn event. The progression of the player will be checked and observers will be registered.
+-- @param pCreatureObject pointer to the creature object of the player who logged in.
+function HolocronJediManager:onPlayerLoggedIn(pCreatureObject)
        HolocronJediManager.checkIfProgressedToJedi(pCreatureObject)
        HolocronJediManager.registerObservers(pCreatureObject)
 end
 
+-- Get the profession name from the badge number. Only used for the temporary debug message in the checkForceCommand.
+-- @param badgeNumber the badge number to find the profession name for.
+-- @return the profession name associated with the badge number, Unknown profession returned if the badge number isn't found.
 function HolocronJediManager.getProfessionNameFromBadgeNumber(badgeNumber)
        local skillList = HolocronJediManager.getGrindableProfessionList()
        for i = 1, table.getn(skillList), 1 do
@@ -113,6 +130,9 @@ function HolocronJediManager.getProfessionNameFromBadgeNumber(badgeNumber)
        return "Unknown profession"
 end
 
+-- Handling of the checkForceCommand.
+-- Temporary debug message print out during test. This function should be empty when everything has been tested.
+-- @param pCreatureObject pointer to the creature object for the player performing the command.
 function HolocronJediManager:checkForceStatusCommand(pCreatureObject)
        HolocronJediManager.withCreatureAndPlayerObject(pCreatureObject, function(creatureObject, playerObject)
                creatureObject:sendSystemMessage("Debug information for the holocron jedi progression system.")
index 4826463..22f4779 100644 (file)
@@ -71,22 +71,31 @@ function JediManager.withCreatureAndPlayerObject(pCreatureObject, performThisFun
        end)
 end
 
+-- Default handling of the start event.
 function JediManager:start()
        -- Default behaviour for the start event, do nothing.
 end
 
-function JediManager:onPlayerCreation(pCreatureObject)
-       -- Default behaviour for the onPlayerCreation event, do nothing.
+-- Default handling of the onPlayerCreated event.
+-- @param pCreatureObject pointer to the creature object for the player that was created.
+function JediManager:onPlayerCreated(pCreatureObject)
+       -- Default behaviour for the onPlayerCreated event, do nothing.
 end
 
-function JediManager:onPlayerLogin(pCreatureObject)
-       -- Default behaviour for the onPlayerLogin event, do nothing.
+-- Default handling of the onPlayerLoggedIn event.
+-- @param pCreatureObject pointer to the creature object for the player that logged in.
+function JediManager:onPlayerLoggedIn(pCreatureObject)
+       -- Default behaviour for the onPlayerLoggedIn event, do nothing.
 end
 
-function JediManager:onPlayerLogout(pCreatureObject)
-       -- Default behaviour for the onPlayerLogout event, do nothing.
+-- Default handling of the onPlayerLoggedOut event.
+-- @param pCreatureObject pointer to the creature object for the player that logged out.
+function JediManager:onPlayerLoggedOut(pCreatureObject)
+       -- Default behaviour for the onPlayerLoggedOut event, do nothing.
 end
 
+-- Default handling of the checkForceStatus command.
+-- @param pCreatureObject pointer to the creature object for the player that performed the command.
 function JediManager:checkForceStatusCommand(pCreatureObject)
        -- Default behaviour for the checkForceStatus command, do nothing.
 end
index 6dd88bb..21483c1 100644 (file)
@@ -29,7 +29,7 @@ describe("Holocron Jedi Manager", function()
                        return performThisFunction({ addHologrindProfession = addHologrindProfessionSpy }) 
                end)
 
-               HolocronJediManager.onPlayerCreation(creaturePointer)
+               HolocronJediManager.onPlayerCreated(creaturePointer)
 
                assert.spy(HolocronJediManager.withCreaturePlayerObject).was.called(1)
                assert.spy(addHologrindProfessionSpy).was.called(EXPECTEDNUMBEROFPROFESSIONSTOGRIND)
index b0924d8..2b7acc6 100644 (file)
@@ -93,25 +93,25 @@ void JediManager::start(Lua* luaEngine) {
        luaEngine->callFunction(&luaCheckForceStatusCommand);
 }
 
-void JediManager::onPlayerCreation(CreatureObject* creature) {
+void JediManager::onPlayerCreated(CreatureObject* creature) {
        Lua* lua = DirectorManager::instance()->getLuaInstance();
-       LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "onPlayerCreation", 0);
+       LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "onPlayerCreated", 0);
        luaCheckForceStatusCommand << creature;
 
        lua->callFunction(&luaCheckForceStatusCommand);
 }
 
-void JediManager::onPlayerLogin(CreatureObject* creature) {
+void JediManager::onPlayerLoggedIn(CreatureObject* creature) {
        Lua* lua = DirectorManager::instance()->getLuaInstance();
-       LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "onPlayerLogin", 0);
+       LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "onPlayerLoggedIn", 0);
        luaCheckForceStatusCommand << creature;
 
        lua->callFunction(&luaCheckForceStatusCommand);
 }
 
-void JediManager::onPlayerLogout(CreatureObject* creature) {
+void JediManager::onPlayerLoggedOut(CreatureObject* creature) {
        Lua* lua = DirectorManager::instance()->getLuaInstance();
-       LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "onPlayerLogout", 0);
+       LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "onPlayerLoggedOut", 0);
        luaCheckForceStatusCommand << creature;
 
        lua->callFunction(&luaCheckForceStatusCommand);
index fb026ee..295acbd 100644 (file)
@@ -112,22 +112,22 @@ public:
        void start(Lua* luaEngine);
 
        /**
-        * On player creation.
+        * On player created.
         * @param creature the creature/player that was created.
         */
-       void onPlayerCreation(CreatureObject* creature);
+       void onPlayerCreated(CreatureObject* creature);
 
        /**
-        * On player login.
+        * On player logged in.
         * @param creature the creature/player that logged in.
         */
-       void onPlayerLogin(CreatureObject* creature);
+       void onPlayerLoggedIn(CreatureObject* creature);
 
        /**
-        * On player logout.
+        * On player logged out.
         * @param creature the creature/player that logged out.
         */
-       void onPlayerLogout(CreatureObject* creature);
+       void onPlayerLoggedOut(CreatureObject* creature);
 
        /**
         * Check force status command.
index 183a42b..ad00de0 100644 (file)
@@ -612,7 +612,7 @@ bool PlayerCreationManager::createCharacter(MessageCallback* data) {
 
        client->addCharacter(playerCreature->getObjectID(), zoneServer.get()->getGalaxyID());
 
-       JediManager::instance()->onPlayerCreation(playerCreature);
+       JediManager::instance()->onPlayerCreated(playerCreature);
 
        return true;
 }
index a1509fe..86adba4 100644 (file)
@@ -1129,7 +1129,7 @@ void PlayerObjectImplementation::notifyOnline() {
        VisibilityManager::instance()->login(playerCreature);
 
        //Login to jedi manager
-       JediManager::instance()->onPlayerLogin(playerCreature);
+       JediManager::instance()->onPlayerLoggedIn(playerCreature);
 }
 
 void PlayerObjectImplementation::notifyOffline() {
@@ -1158,7 +1158,7 @@ void PlayerObjectImplementation::notifyOffline() {
        VisibilityManager::instance()->logout(playerCreature);
 
        //Logout from jedi manager
-       JediManager::instance()->onPlayerLogout(playerCreature);
+       JediManager::instance()->onPlayerLoggedOut(playerCreature);
 }
 
 void PlayerObjectImplementation::setLanguageID(byte language, bool notifyClient) {