/* -*-c++-*- * testGameActorLibrary - This source file (.h & .cpp) - Using 'The MIT License' * Copyright (C) 2006-2008, Alion Science and Technology Corporation * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * This software was developed by Alion Science and Technology Corporation under * circumstances in which the U. S. Government may have rights in the software. * * William E. Johnson II */ #include "testgameactorlibrary.h" #include "testgameactor.h" #include "testgameactor2.h" #include "testgameactorcrash.h" #include "testhlaobject.h" #include "testplayer.h" #include "countertaskactor.h" #include "testgameenvironmentactor.h" #include "testgamepropertyproxy.h" #include #include #include #include dtCore::RefPtr TestGameActorLibrary::TEST1_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Test1Actor", "ExampleActors", "These are example actors")); dtCore::RefPtr TestGameActorLibrary::TEST2_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Test2Actor", "ExampleActors", "These are example actors")); dtCore::RefPtr TestGameActorLibrary::TEST_GAME_ACTOR_CRASH_PROXY_TYPE( new dtDAL::ActorType("TestCrash","ExampleActors", "An actor that throws an exception as it enters the world.")); dtCore::RefPtr TestGameActorLibrary::TEST_PLAYER_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("TestPlayer","ExampleActors", "Simple player actor.")); dtCore::RefPtr TestGameActorLibrary::TEST_TASK_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Task Actor","dtcore.Tasks")); dtCore::RefPtr TestGameActorLibrary::TEST_COUNTER_TASK_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Counter Task","ExampleActors", "" "task actor that provides a simple counter of something happening.", TEST_TASK_GAME_ACTOR_PROXY_TYPE.get())); dtCore::RefPtr TestGameActorLibrary::TEST_TANK_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Tank", "TestHLA", "These are test HLA mapping actors")); dtCore::RefPtr TestGameActorLibrary::TEST_JET_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Jet", "TestHLA", "These are test HLA mapping actors")); dtCore::RefPtr TestGameActorLibrary::TEST_CULTURAL_FEATURE_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("CulturalFeature", "TestHLA", "These are test HLA mapping actors")); dtCore::RefPtr TestGameActorLibrary::TEST_SENSOR_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Sensor", "TestHLA", "These are test HLA mapping actors")); dtCore::RefPtr TestGameActorLibrary::TEST_HELICOPTER_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("Helicopter", "TestHLA", "These are test HLA mapping actors")); dtCore::RefPtr TestGameActorLibrary::TEST_ENVIRONMENT_GAME_ACTOR_PROXY_TYPE( new dtDAL::ActorType("TestEnvironmentActor", "ExampleActors", "These are example actors")); dtCore::RefPtr TestGameActorLibrary::TEST_GAME_PROPERTY_PROXY_TYPE( new dtDAL::ActorType("TestGamePropertyProxy", "ExampleActors", "Has an example of most property types")); extern "C" DT_EXAMPLE_EXPORT dtDAL::ActorPluginRegistry* CreatePluginRegistry() { return new TestGameActorLibrary; } extern "C" DT_EXAMPLE_EXPORT void DestroyPluginRegistry(dtDAL::ActorPluginRegistry* registry) { if (registry != NULL) delete registry; } TestGameActorLibrary::TestGameActorLibrary() : dtDAL::ActorPluginRegistry("TestGameActorLibrary") { } void TestGameActorLibrary::RegisterActorTypes() { mActorFactory->RegisterType (TEST1_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST2_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_GAME_ACTOR_CRASH_PROXY_TYPE.get()); mActorFactory->RegisterType(TEST_PLAYER_GAME_ACTOR_PROXY_TYPE.get()); //This is the actor type for the task actor located in dtActors. All custom //subclasses should at the very least be a sub actor type of this one. mActorFactory->RegisterType(TEST_COUNTER_TASK_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_TANK_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_JET_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_CULTURAL_FEATURE_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_SENSOR_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_HELICOPTER_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_ENVIRONMENT_GAME_ACTOR_PROXY_TYPE.get()); mActorFactory->RegisterType (TEST_GAME_PROPERTY_PROXY_TYPE.get()); }