diff options
author | rubidium <rubidium@openttd.org> | 2009-07-04 11:26:57 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-04 11:26:57 +0000 |
commit | 571dfb90557e20f0f3b62288856eef68cc95ed1f (patch) | |
tree | d811e87b06b0b8fd7bd210b2d2007956d498d5c8 /src/core | |
parent | 65f77a7bee0158dcc3aedc0a360ff65597dad1c8 (diff) | |
download | openttd-571dfb90557e20f0f3b62288856eef68cc95ed1f.tar.xz |
(svn r16736) -Codechange: give some station enums a name and use that instead of 'byte'.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/enum_type.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/enum_type.hpp b/src/core/enum_type.hpp index 1560d42d6..8df7920d3 100644 --- a/src/core/enum_type.hpp +++ b/src/core/enum_type.hpp @@ -145,6 +145,20 @@ struct SimpleTinyEnumT { this->m_val = (storage_type)u; return *this; } + + /** Bit math (or) assignment operator (from enum_type) */ + FORCEINLINE SimpleTinyEnumT &operator |= (enum_type e) + { + this->m_val = (storage_type)((enum_type)this->m_val | e); + return *this; + } + + /** Bit math (and) assignment operator (from enum_type) */ + FORCEINLINE SimpleTinyEnumT &operator &= (enum_type e) + { + this->m_val = (storage_type)((enum_type)this->m_val & e); + return *this; + } }; #endif /* ENUM_TYPE_HPP */ |