2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:07:42 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -2,37 +2,36 @@
#include "IAnimReader.hpp"
namespace urde
{
namespace urde {
class CAnimTreeNode : public IAnimReader
{
class CAnimTreeNode : public IAnimReader {
protected:
std::string x4_name;
std::string x4_name;
public:
CAnimTreeNode(std::string_view name) : x4_name(name) {}
bool IsCAnimTreeNode() const {return true;}
static std::shared_ptr<CAnimTreeNode> Cast(std::unique_ptr<IAnimReader>&& ptr)
{
if (ptr->IsCAnimTreeNode())
return std::static_pointer_cast<CAnimTreeNode>(std::shared_ptr<IAnimReader>(std::move(ptr)));
return {};
}
CAnimTreeNode(std::string_view name) : x4_name(name) {}
bool IsCAnimTreeNode() const { return true; }
static std::shared_ptr<CAnimTreeNode> Cast(std::unique_ptr<IAnimReader>&& ptr) {
if (ptr->IsCAnimTreeNode())
return std::static_pointer_cast<CAnimTreeNode>(std::shared_ptr<IAnimReader>(std::move(ptr)));
return {};
}
virtual u32 Depth() const=0;
virtual CAnimTreeEffectiveContribution VGetContributionOfHighestInfluence() const=0;
virtual u32 VGetNumChildren() const=0;
virtual std::shared_ptr<IAnimReader> VGetBestUnblendedChild() const=0;
virtual void VGetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out, float w) const=0;
void GetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out, float w) const
{ VGetWeightedReaders(out, w); }
virtual u32 Depth() const = 0;
virtual CAnimTreeEffectiveContribution VGetContributionOfHighestInfluence() const = 0;
virtual u32 VGetNumChildren() const = 0;
virtual std::shared_ptr<IAnimReader> VGetBestUnblendedChild() const = 0;
virtual void VGetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out,
float w) const = 0;
void GetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out, float w) const {
VGetWeightedReaders(out, w);
}
CAnimTreeEffectiveContribution GetContributionOfHighestInfluence() const;
u32 GetNumChildren() const;
std::shared_ptr<IAnimReader> GetBestUnblendedChild() const;
CAnimTreeEffectiveContribution GetContributionOfHighestInfluence() const;
u32 GetNumChildren() const;
std::shared_ptr<IAnimReader> GetBestUnblendedChild() const;
std::string_view GetName() const { return x4_name; }
std::string_view GetName() const { return x4_name; }
};
}
} // namespace urde