-
Notifications
You must be signed in to change notification settings - Fork 1
/
AgsImVec2.h
73 lines (51 loc) · 1.6 KB
/
AgsImVec2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright (C) 2020 Érico Vieira Porto
*
* This program is free software. You can use and redistribute it
* under the terms and conditions of the MIT License (see LICENCE).
*/
#pragma once
#ifndef _AGSIMVEC2_H
#define _AGSIMVEC2_H
#include "plugin/agsplugin.h"
class AgsImVec2
{
float _x = 0.0;
float _y = 0.0;
public:
AgsImVec2(float x, float y);
~AgsImVec2(void);
void SetX(float x);
float GetX();
void SetY(float y);
float GetY();
AgsImVec2* Scale(float scale);
float Length();
float SquaredLength();
AgsImVec2* Add(AgsImVec2* AgsImVec2);
AgsImVec2* Sub(AgsImVec2* AgsImVec2);
};
//------------------------------------------------------------------------------
// AGS interface instances
class AgsImVec2Interface : public IAGSScriptManagedObject
{
public:
static const char* name;
AgsImVec2Interface() {};
virtual int Dispose(const char* address, bool force);
virtual const char* GetType() { return (name); }
virtual int Serialize(const char* address, char* buffer, int bufsize);
};
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class AgsImVec2Reader : public IAGSManagedObjectReader
{
public:
AgsImVec2Reader() {}
virtual void Unserialize(int key, const char* serializedData, int dataSize);
};
//------------------------------------------------------------------------------
extern AgsImVec2Interface AgsImVec2_Interface;
extern AgsImVec2Reader AgsImVec2_Reader;
//------------------------------------------------------------------------------
#endif /* _AGSIMVEC2_H */
//............