summaryrefslogtreecommitdiffstats
path: root/simple-classes.hpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-12-08 12:58:04 +0100
committerNao Pross <naopross@thearcway.org>2018-12-08 12:58:04 +0100
commit05f2df34290af477b0fee49b75e5f56e1d6c83f9 (patch)
tree66a7214321c874be02d1a4a9b4fd3f489dc09ad8 /simple-classes.hpp
downloadcplusplus-05f2df34290af477b0fee49b75e5f56e1d6c83f9.tar.gz
cplusplus-05f2df34290af477b0fee49b75e5f56e1d6c83f9.zip
Initial commit with kinda crappy unnumbered examples
Diffstat (limited to 'simple-classes.hpp')
-rw-r--r--simple-classes.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/simple-classes.hpp b/simple-classes.hpp
new file mode 100644
index 0000000..80743d4
--- /dev/null
+++ b/simple-classes.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+namespace math {
+ // a class is a glorified struct
+ class vec3i {
+ public:
+ // members
+ int x;
+ int y;
+ int z;
+
+ // default constructor
+ vec3i();
+ // copy constructor
+ vec3i(const vec3i& other);
+ // custom constructor
+ vec3i(int x_, int y_, int z_);
+
+ // method
+ void zero();
+ int dot(const vec3i& other) const;
+ };
+}