-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to be inline with GManager class, rob's savefile managing system. makes the source more readable for rob, hopefully. also cleaned up visuals a lot and added an options / credits menu.
- Loading branch information
1 parent
fde7117
commit e241cdd
Showing
215 changed files
with
27,037 additions
and
688 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#ifndef __DS_DICTIONARY_H__ | ||
#define __DS_DICTIONARY_H__ | ||
|
||
#include "pugixml.hpp" | ||
#include <vector> | ||
#include <cocos2d.h> | ||
|
||
class CC_DLL DS_Dictionary { | ||
private: | ||
pugi::xml_document doc; | ||
std::vector<pugi::xml_node> dictTree; | ||
bool m_bCompatible; | ||
|
||
private: | ||
std::string cleanStringWhiteSpace(const std::string&); | ||
void split(const std::string&, char*, const std::vector<std::string>&); | ||
bool splitWithForm(const std::string&, std::vector<std::string>&); | ||
bool rectFromString(const std::string&, cocos2d::CCRect&); | ||
bool vec2FromString(const std::string&, cocos2d::CCPoint&); | ||
|
||
public: | ||
DS_Dictionary(); | ||
~DS_Dictionary(); | ||
|
||
static void copyFile(const char*, const char*); | ||
|
||
cocos2d::CCObject* decodeObjectForKey(const char*, bool, int); | ||
|
||
bool loadRootSubDictFromFile(const char*); | ||
bool loadRootSubDictFromCompressedFile(const char*); | ||
bool loadRootSubDictFromString(std::string); | ||
|
||
bool saveRootSubDictToFile(const char*); | ||
bool saveRootSubDictToCompressedFile(const char*); | ||
std::string saveRootSubDictToString(); | ||
|
||
bool stepIntoSubDictWithKey(const char*); | ||
void stepOutOfSubDict(); | ||
void stepBackToRootSubDict(); | ||
|
||
unsigned int getNumKeys(); | ||
std::string getKey(unsigned int); | ||
std::vector<std::string> getAllKeys(); | ||
unsigned int getIndexOfKey(const char*); | ||
unsigned int getIndexOfKeyWithClosestAlphaNumericalMatch(const char*); | ||
void removeKey(unsigned int); | ||
void removeKey(const char*); | ||
void removeAllKeys(); | ||
|
||
int getIntegerForKey(const char*); | ||
bool getBoolForKey(const char*); | ||
float getFloatForKey(const char*); | ||
std::string getStringForKey(const char*); | ||
cocos2d::CCPoint getVec2ForKey(const char*); | ||
cocos2d::CCRect getRectForKey(const char*); | ||
std::vector<std::string> getStringArrayForKey(const char*); | ||
std::vector<cocos2d::CCPoint> getVec2ArrayForKey(const char*); | ||
std::vector<cocos2d::CCRect> getRectArrayForKey(const char*); | ||
cocos2d::CCArray* getArrayForKey(const char*, bool); | ||
cocos2d::CCDictionary* getDictForKey(const char*, bool); | ||
cocos2d::CCObject* getObjectForKey(const char*); | ||
|
||
void setIntegerForKey(const char*, int); | ||
void setIntegerForKey(const char*, int, bool); | ||
void setBoolForKey(const char*, bool); | ||
void setBoolForKey(const char*, bool, bool); | ||
void setFloatForKey(const char*, float); | ||
void setFloatForKey(const char*, float, bool); | ||
void setStringForKey(const char*, const std::string&); | ||
void setStringForKey(const char*, const std::string&, bool); | ||
void setVec2ForKey(const char*, const cocos2d::CCPoint&); | ||
void setVec2ForKey(const char*, const cocos2d::CCPoint&, bool); | ||
void setRectForKey(const char*, const cocos2d::CCRect&); | ||
void setRectForKey(const char*, const cocos2d::CCRect&, bool); | ||
void setStringArrayForKey(const char*, const std::vector<std::string>&); | ||
void setStringArrayForKey(const char*, const std::vector<std::string>&, bool); | ||
void setVec2ArrayForKey(const char*, const std::vector<cocos2d::CCPoint>&); | ||
void setVec2ArrayForKey(const char*, const std::vector<cocos2d::CCPoint>&, bool); | ||
void setRectArrayForKey(const char*, const std::vector<cocos2d::CCRect>&); | ||
void setRectArrayForKey(const char*, const std::vector<cocos2d::CCRect>&, bool); | ||
void setArrayForKey(const char*, cocos2d::CCArray*); | ||
void setBoolMapForKey(const char*, const std::map<std::string, bool>&); | ||
void setSubDictForKey(const char*); | ||
void setSubDictForKey(const char*, bool, bool); | ||
void setDictForKey(const char*, cocos2d::CCDictionary*); | ||
void setObjectForKey(const char*, cocos2d::CCObject*); | ||
|
||
void addBoolValuesToMapForKey(const std::map<std::string, bool>&, const char*, bool); | ||
void addBoolValuesToMapForKeySpecial(const std::map<std::string, bool>&, const char*, bool); | ||
|
||
void checkCompatibility(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* pugixml parser - version 1.2 | ||
* -------------------------------------------------------- | ||
* Copyright (C) 2006-2012, by Arseny Kapoulkine ([email protected]) | ||
* Report bugs and download new versions at http://pugixml.org/ | ||
* | ||
* This library is distributed under the MIT License. See notice at the end | ||
* of this file. | ||
* | ||
* This work is based on the pugxml parser, which is: | ||
* Copyright (C) 2003, by Kristen Wegner ([email protected]) | ||
*/ | ||
|
||
#ifndef HEADER_PUGICONFIG_HPP | ||
#define HEADER_PUGICONFIG_HPP | ||
|
||
// Uncomment this to enable wchar_t mode | ||
// #define PUGIXML_WCHAR_MODE | ||
|
||
// Uncomment this to disable XPath | ||
// #define PUGIXML_NO_XPATH | ||
|
||
// Uncomment this to disable STL | ||
// #define PUGIXML_NO_STL | ||
|
||
// Uncomment this to disable exceptions | ||
// #define PUGIXML_NO_EXCEPTIONS | ||
|
||
// Set this to control attributes for public classes/functions, i.e.: | ||
// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL | ||
// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL | ||
// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall | ||
// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead | ||
|
||
// Uncomment this to switch to header-only version | ||
// #define PUGIXML_HEADER_ONLY | ||
// #include "pugixml.cpp" | ||
|
||
// Tune these constants to adjust memory-related behavior | ||
// #define PUGIXML_MEMORY_PAGE_SIZE 32768 | ||
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240 | ||
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096 | ||
|
||
#endif | ||
|
||
/** | ||
* Copyright (c) 2006-2012 Arseny Kapoulkine | ||
* | ||
* Permission is hereby granted, free of charge, to any person | ||
* obtaining a copy of this software and associated documentation | ||
* files (the "Software"), to deal in the Software without | ||
* restriction, including without limitation the rights to use, | ||
* copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following | ||
* conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
*/ |
Oops, something went wrong.