2022-02-04 22:24:45 -08:00
|
|
|
|
/* Copyright (C) 2022 Wildfire Games.
|
2023-07-27 13:54:46 -07:00
|
|
|
|
* This file is part of 0 A.D.
|
2010-01-22 12:03:14 -08:00
|
|
|
|
*
|
2023-07-27 13:54:46 -07:00
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
2010-01-22 12:03:14 -08:00
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
*
|
2023-07-27 13:54:46 -07:00
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
2010-01-22 12:03:14 -08:00
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2023-07-27 13:54:46 -07:00
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
2010-01-22 12:03:14 -08:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "precompiled.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "ICmpPlayer.h"
|
|
|
|
|
|
|
2019-01-13 07:38:41 -08:00
|
|
|
|
#include "graphics/Color.h"
|
2011-06-13 16:32:41 -07:00
|
|
|
|
#include "maths/FixedVector3D.h"
|
2010-01-22 12:03:14 -08:00
|
|
|
|
#include "simulation2/system/InterfaceScripted.h"
|
|
|
|
|
|
#include "simulation2/scripting/ScriptComponent.h"
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_INTERFACE_WRAPPER(Player)
|
|
|
|
|
|
END_INTERFACE_WRAPPER(Player)
|
|
|
|
|
|
|
|
|
|
|
|
class CCmpPlayerScripted : public ICmpPlayer
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
DEFAULT_SCRIPT_WRAPPER(PlayerScripted)
|
|
|
|
|
|
|
2022-03-07 15:04:11 -08:00
|
|
|
|
CColor GetDisplayedColor() override
|
2010-04-23 11:36:48 -07:00
|
|
|
|
{
|
2018-02-03 06:17:31 -08:00
|
|
|
|
return m_Script.Call<CColor>("GetDisplayedColor");
|
2010-04-23 11:36:48 -07:00
|
|
|
|
}
|
2011-06-13 16:32:41 -07:00
|
|
|
|
|
2022-03-07 15:04:11 -08:00
|
|
|
|
CFixedVector3D GetStartingCameraPos() override
|
2011-06-13 16:32:41 -07:00
|
|
|
|
{
|
2011-06-16 14:21:33 -07:00
|
|
|
|
return m_Script.Call<CFixedVector3D>("GetStartingCameraPos");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-07 15:04:11 -08:00
|
|
|
|
CFixedVector3D GetStartingCameraRot() override
|
2011-06-16 14:21:33 -07:00
|
|
|
|
{
|
|
|
|
|
|
return m_Script.Call<CFixedVector3D>("GetStartingCameraRot");
|
2011-06-13 16:32:41 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-07 15:04:11 -08:00
|
|
|
|
bool HasStartingCamera() override
|
2011-06-13 16:32:41 -07:00
|
|
|
|
{
|
|
|
|
|
|
return m_Script.Call<bool>("HasStartingCamera");
|
|
|
|
|
|
}
|
2017-05-23 12:26:33 -07:00
|
|
|
|
|
2022-03-07 15:04:11 -08:00
|
|
|
|
std::string GetState() override
|
2017-05-23 12:26:33 -07:00
|
|
|
|
{
|
|
|
|
|
|
return m_Script.Call<std::string>("GetState");
|
|
|
|
|
|
}
|
2010-01-22 12:03:14 -08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
REGISTER_COMPONENT_SCRIPT_WRAPPER(PlayerScripted)
|