Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpVisual.h
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 40 Lines | public: | ||||
/** | /** | ||||
* Get the world-space position of the base point of the object's visual representation. | * Get the world-space position of the base point of the object's visual representation. | ||||
* (Not safe for use in simulation code.) | * (Not safe for use in simulation code.) | ||||
*/ | */ | ||||
virtual CVector3D GetPosition() const = 0; | virtual CVector3D GetPosition() const = 0; | ||||
/** | /** | ||||
* Return the short name of the actor that's being displayed, or the empty string on error. | |||||
* (Not safe for use in simulation code.) | |||||
*/ | |||||
virtual std::wstring GetActorShortName() const = 0; | |||||
/** | |||||
* Return the filename of the actor to be used for projectiles from this unit, or the empty string if none. | * Return the filename of the actor to be used for projectiles from this unit, or the empty string if none. | ||||
* (Not safe for use in simulation code.) | * (Not safe for use in simulation code.) | ||||
*/ | */ | ||||
virtual std::wstring GetProjectileActor() const = 0; | virtual std::wstring GetProjectileActor() const = 0; | ||||
/** | /** | ||||
* Return the exact position where a projectile should be launched from (based on the actor's | * Return the exact position where a projectile should be launched from (based on the actor's | ||||
* ammo prop points). | * ammo prop points). | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | public: | ||||
* Returns true if this entity should have a construction preview | * Returns true if this entity should have a construction preview | ||||
*/ | */ | ||||
virtual bool HasConstructionPreview() const = 0; | virtual bool HasConstructionPreview() const = 0; | ||||
/** | /** | ||||
* Called when an actor file has been modified and reloaded dynamically. | * Called when an actor file has been modified and reloaded dynamically. | ||||
* If this component uses the named actor file, it should regenerate its actor | * If this component uses the named actor file, it should regenerate its actor | ||||
* to pick up the new definitions. | * to pick up the new definitions. | ||||
* If name is empty, this reloads all the time. This is used when global quality settings change. | |||||
*/ | */ | ||||
virtual void Hotload(const VfsPath& name) = 0; | virtual void Hotload(const VfsPath& name = L"") = 0; | ||||
DECLARE_INTERFACE_TYPE(Visual) | DECLARE_INTERFACE_TYPE(Visual) | ||||
}; | }; | ||||
// TODO: rename this to VisualActor, because the interface is actor-specific, maybe? | // TODO: rename this to VisualActor, because the interface is actor-specific, maybe? | ||||
#endif // INCLUDED_ICMPVISUAL | #endif // INCLUDED_ICMPVISUAL |
Wildfire Games · Phabricator