Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
Vector3i.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE_VECTOR3I_H
13#define TT_INCLUDE_VECTOR3I_H
14class Vector3i
15{
16public:
17 int I;
18 int J;
19 int K;
20 inline Vector3i(void)
21 {
22 }
23 inline Vector3i(int i,int j,int k)
24 {
25 I = i; J = j; K = k;
26 }
27 inline bool operator== (const Vector3i & v) const
28 {
29 return (I == v.I && J == v.J && K == v.K);
30 }
31 inline bool operator!= (const Vector3i& v) const
32 {
33 return !(I == v.I && J == v.J && K == v.K);
34 }
35 inline const int& operator[] (int n) const
36 {
37 return ((int*)this)[n];
38 }
39 inline int& operator[] (int n)
40 {
41 return ((int*)this)[n];
42 }
43};
44class Vector3i16 {
45public:
46 unsigned short I;
47 unsigned short J;
48 unsigned short K;
49 inline Vector3i16(void)
50 {
51 }
52 inline Vector3i16(unsigned short i,unsigned short j,unsigned short k)
53 {
54 I = i; J = j; K = k;
55 }
56 inline const unsigned short & operator[] (int n) const
57 {
58 return ((unsigned short *)this)[n];
59 }
60 inline unsigned short & operator[] (int n)
61 {
62 return ((unsigned short *)this)[n];
63 }
64};
65
66#endif