00001 /* 00002 * Game Genie Encoder/Decoder 00003 * Copyright (C) 2004-2006,2008 emuWorks 00004 * http://games.technoplaza.net/ 00005 * 00006 * This file is part of Game Genie Encoder/Decoder. 00007 * 00008 * Game Genie Encoder/Decoder is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * Game Genie Encoder/Decoder is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with Game Genie Encoder/Decoder; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 // $Id: comparerawcode.hh,v 1.6 2008/12/18 03:23:30 jdratlif Exp $ 00024 00025 #ifndef GGENCODER_COMPARERAWCODE_HH_ 00026 #define GGENCODER_COMPARERAWCODE_HH_ 00027 00028 namespace ggencoder { 00029 /** 00030 * A raw code interface with a compare value. 00031 */ 00032 class CompareRawCode { 00033 protected: 00034 int compare; 00035 00036 public: 00037 /** 00038 * Checks if this CompareRawCode uses a compare value. 00039 * 00040 * @return true if a compare is used; false otherwise. 00041 */ 00042 bool hasCompare() const; 00043 00044 /** 00045 * Gets the compare value of this CompareRawCode. 00046 * 00047 * @return The compare value. 00048 */ 00049 int getCompare() const; 00050 00051 /** 00052 * Sets the compare value of this CompareRawCode. 00053 * 00054 * @param compare The new compare value. 00055 */ 00056 void setCompare(int compare); 00057 }; 00058 00059 inline bool CompareRawCode::hasCompare() const 00060 { return (compare != -1); } 00061 inline int CompareRawCode::getCompare() const 00062 { return compare; } 00063 inline void CompareRawCode::setCompare(int compare) 00064 { this->compare = (compare & 0xFF); }; 00065 } 00066 00067 #endif 00068