1#include "Player/CollidedShapeResult.h"
2
3#include "Util/CollisionShapeFunction.h"
4
5CollidedShapeResult::CollidedShapeResult(const CollisionShapeInfoBase* shapeInfo)
6 : mShapeInfo(shapeInfo) {}
7
8void CollidedShapeResult::setArrowHitInfo(const al::ArrowHitInfo& arrowHitInfo) {
9 *mArrowHitInfo.hitInfo = *arrowHitInfo.hitInfo;
10}
11
12void CollidedShapeResult::setSphereHitInfo(const al::SphereHitInfo& sphereHitInfo) {
13 *mSphereHitInfo.hitInfo = *sphereHitInfo.hitInfo;
14}
15
16void CollidedShapeResult::setDiskHitInfo(const al::DiskHitInfo& diskHitInfo) {
17 *mDiskHitInfo.hitInfo = *diskHitInfo.hitInfo;
18}
19
20bool CollidedShapeResult::isArrow() const {
21 return CollisionShapeFunction::isShapeArrow(shape: mShapeInfo);
22}
23
24bool CollidedShapeResult::isSphere() const {
25 return CollisionShapeFunction::isShapeSphere(shape: mShapeInfo);
26}
27
28bool CollidedShapeResult::isDisk() const {
29 return CollisionShapeFunction::isShapeDisk(shape: mShapeInfo);
30}
31
32const al::ArrowHitInfo& CollidedShapeResult::getArrowHitInfo() const {
33 return mArrowHitInfo;
34}
35
36const al::SphereHitInfo& CollidedShapeResult::getSphereHitInfo() const {
37 return mSphereHitInfo;
38}
39
40const al::DiskHitInfo& CollidedShapeResult::getDiskHitInfo() const {
41 return mDiskHitInfo;
42}
43
44const CollisionShapeInfoArrow* CollidedShapeResult::getShapeInfoArrow() const {
45 return CollisionShapeFunction::getShapeInfoArrow(shape: mShapeInfo);
46}
47
48const CollisionShapeInfoSphere* CollidedShapeResult::getShapeInfoSphere() const {
49 return CollisionShapeFunction::getShapeInfoSphere(shape: mShapeInfo);
50}
51
52const CollisionShapeInfoDisk* CollidedShapeResult::getShapeInfoDisk() const {
53 return CollisionShapeFunction::getShapeInfoDisk(shape: mShapeInfo);
54}
55
56void CollidedShapeResult::operator=(const CollidedShapeResult& other) {
57 mShapeInfo = other.mShapeInfo;
58 setArrowHitInfo(other.mArrowHitInfo);
59 setSphereHitInfo(other.mSphereHitInfo);
60 setDiskHitInfo(other.mDiskHitInfo);
61}
62