1 /* Copyright (C) 2018 Wildfire Games. 2 * This file is part of 0 A.D. 3 * 4 * 0 A.D. is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * 0 A.D. is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #include "precompiled.h" 19 20 #include "ICmpPlayer.h" 21 22 #include "maths/FixedVector3D.h" 23 #include "simulation2/system/InterfaceScripted.h" 24 #include "simulation2/scripting/ScriptComponent.h" 25 26 #include "ps/Shapes.h" 27 28 BEGIN_INTERFACE_WRAPPER(Player) 29 END_INTERFACE_WRAPPER(Player) 30 31 class CCmpPlayerScripted : public ICmpPlayer 32 { 33 public: DEFAULT_SCRIPT_WRAPPER(PlayerScripted)34 DEFAULT_SCRIPT_WRAPPER(PlayerScripted) 35 36 virtual CColor GetDisplayedColor() 37 { 38 return m_Script.Call<CColor>("GetDisplayedColor"); 39 } 40 GetCiv()41 virtual std::wstring GetCiv() 42 { 43 return m_Script.Call<std::wstring>("GetCiv"); 44 } 45 GetStartingCameraPos()46 virtual CFixedVector3D GetStartingCameraPos() 47 { 48 return m_Script.Call<CFixedVector3D>("GetStartingCameraPos"); 49 } 50 GetStartingCameraRot()51 virtual CFixedVector3D GetStartingCameraRot() 52 { 53 return m_Script.Call<CFixedVector3D>("GetStartingCameraRot"); 54 } 55 HasStartingCamera()56 virtual bool HasStartingCamera() 57 { 58 return m_Script.Call<bool>("HasStartingCamera"); 59 } 60 GetState()61 virtual std::string GetState() 62 { 63 return m_Script.Call<std::string>("GetState"); 64 } 65 }; 66 67 REGISTER_COMPONENT_SCRIPT_WRAPPER(PlayerScripted) 68