Skip to content

Commit

Permalink
Removed ItemDTag from PS standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
brennana committed Sep 28, 2012
1 parent bdc43b2 commit 4084747
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 164 deletions.
2 changes: 0 additions & 2 deletions GameContainer/GameContainer.vcxproj
Expand Up @@ -79,7 +79,6 @@
<ClInclude Include="PBaseWorld.h" />
<ClInclude Include="PGameContainer.h" />
<ClInclude Include="PItem.h" />
<ClInclude Include="PItemDTag.h" />
<ClInclude Include="PItemListItem.h" />
<ClInclude Include="PMap.h" />
<ClInclude Include="PorkString.h" />
Expand All @@ -91,7 +90,6 @@
<ClCompile Include="PBaseWorld.cpp" />
<ClCompile Include="PGameContainer.cpp" />
<ClCompile Include="PItem.cpp" />
<ClCompile Include="PItemDTag.cpp" />
<ClCompile Include="PItemListItem.cpp" />
<ClCompile Include="PMap.cpp" />
<ClCompile Include="PState.cpp" />
Expand Down
6 changes: 0 additions & 6 deletions GameContainer/GameContainer.vcxproj.filters
Expand Up @@ -33,9 +33,6 @@
<ClInclude Include="PItem.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PItemDTag.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PItemListItem.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -65,9 +62,6 @@
<ClCompile Include="PItem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PItemDTag.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PItemListItem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
37 changes: 22 additions & 15 deletions GameContainer/PBaseWorld.h
@@ -1,11 +1,25 @@
//
//
// @ Project : PorkParser
// @ File Name : PBaseWorld.h
// @ Date : 9/16/2011
// @ Author : Andy Brennan
//
//
/***********************************************************************
PorkScript Game Engine (C) 2012 Andy J. Brennan
PBaseWorld.h -- Header file that defines the PBaseWorld class, it acts as
the base for things like Maps and States.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
PorkScript on GitHub: https://github.com/valdez42/porkscript/
*************************************************************************/


#if !defined(_PBASEWORLD_H)
Expand All @@ -21,13 +35,10 @@ using std::map;
using std::string;
#include "PBaseEntity.h"
#include "PItemListItem.h"
#include "PItemDTag.h"
#include "GlobalExceptions.h"

namespace GameContainer
{

typedef map<string, PItemDTag> PItemDTagList;
typedef map<string, PItemListItem> PItemList;

class PBaseWorld : public PBaseEntity
Expand All @@ -43,21 +54,17 @@ namespace GameContainer
map<string, UINT> ListItems();
PItemListItem GetItem(string ID);

void AddItemDTag(string itemID, string desc);
PItemDTag GetItemDTag(string itemID);
private:
template<class Archive>
void serialize(Archive &ar, const UINT version)
{
ar & itsPItemList;
ar & itsPItemDTags;
}

friend class boost::serialization::access;

protected:
PItemList itsPItemList;
PItemDTagList itsPItemDTags;
};
}

Expand Down
25 changes: 0 additions & 25 deletions GameContainer/PItemDTag.cpp

This file was deleted.

71 changes: 0 additions & 71 deletions GameContainer/PItemDTag.h

This file was deleted.

31 changes: 22 additions & 9 deletions GameContainer/PMap.h
@@ -1,11 +1,25 @@
//
//
// @ Project : PorkParser
// @ File Name : PMap.h
// @ Date : 9/16/2011
// @ Author : Andy Brennan
//
//
/***********************************************************************
PorkScript Game Engine (C) 2012 Andy J. Brennan
PMap.h -- Header file that defines the PMap class, which represents one
map in the game.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
PorkScript on GitHub: https://github.com/valdez42/porkscript/
*************************************************************************/


#if !defined(_PMAP_H)
Expand All @@ -22,7 +36,6 @@ using std::string;
#include "GlobalExceptions.h"
#include "PBaseWorld.h"
#include "PState.h"
#include "PItemDTag.h"
#include "PItemListItem.h"

namespace GameContainer
Expand Down
32 changes: 22 additions & 10 deletions GameContainer/PState.h
@@ -1,11 +1,25 @@
//
//
// @ Project : PorkParser
// @ File Name : PState.h
// @ Date : 9/16/2011
// @ Author : Andy Brennan
//
//
/***********************************************************************
PorkScript Game Engine (C) 2012 Andy J. Brennan
PState.h -- Header file that defines the PState class, which represents
a particular map state.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
PorkScript on GitHub: https://github.com/valdez42/porkscript/
*************************************************************************/


#if !defined(_PSTATE_H)
Expand All @@ -15,7 +29,6 @@
using std::string;
#include "PBaseWorld.h"
#include "PItemListItem.h"
#include "PItemDTag.h"

namespace GameContainer
{
Expand All @@ -37,7 +50,6 @@ namespace GameContainer
bool Defintive() const { return isDefinitive; }

// Gross set functions
void SetPItemDTagList(PItemDTagList newList) { itsPItemDTags = newList; }
void SetPItemList(PItemList newList) { itsPItemList = newList; }
private:
template<class Archive>
Expand Down
23 changes: 1 addition & 22 deletions PorkParser/PorkParser.cpp
Expand Up @@ -120,16 +120,6 @@ void PorkParser::InsertMapDef(TempParseInfo *sInfo)
theGameContainer.GetPMap(sInfo->identifier)->AddItem(temp.name, temp.amt, temp.reliesOn, temp.from, temp.condition);
}

// ItemDTags
for(UINT i=0;i<sInfo->itemDTagList.size();i++)
{
TempMItemDTagInfo temp = sInfo->itemDTagList[i];
theGameContainer.GetPMap(sInfo->identifier)->AddItemDTag(temp.forItem, temp.desc);
for(UINT j=0;j<temp.dynPieces.size();j++)
{
theGameContainer.GetPMap(sInfo->identifier)->GetItemDTag(temp.forItem).AddDynPiece(temp.dynPieces[j]);
}
}

// States
for(UINT i=0;i<sInfo->stateList.size();i++)
Expand Down Expand Up @@ -157,17 +147,6 @@ void PorkParser::InsertMapDef(TempParseInfo *sInfo)
TempMItemListInfo temp = temps.itemList[j];
state->AddItem(temp.name, temp.amt, temp.reliesOn, temp.from, temp.condition);
}

// ItemDTags
for(UINT j=0;j<sInfo->itemDTagList.size();j++)
{
TempMItemDTagInfo temp = temps.itemDTagList[j];
state->AddItemDTag(temp.forItem, temp.desc);
for(UINT k=0;k<temp.dynPieces.size();k++)
{
state->GetItemDTag(temp.forItem).AddDynPiece(temp.dynPieces[k]);
}
}
}

return;
Expand Down Expand Up @@ -209,7 +188,7 @@ pork_grammar::pork_grammar():

set_statement_property_dynamic %=
lit("set") >> lit("dynamic") > qualifier > value > lit(":") >
+(+char_ > value) >
+(identifier > value) >
lit("eset");

set_statement_state %=
Expand Down
2 changes: 1 addition & 1 deletion PorkParser/PorkParser.h
Expand Up @@ -146,7 +146,7 @@ namespace PorkParserSpace

std::string filename;
qi::rule<Iterator, std::string(), ascii::space_type> quoted_string;
qi::rule<Iterator, PVariant, ascii:space_type> value;
qi::rule<Iterator, PVariant, ascii::space_type> value;
};

// Class PorkParser -- represents the .pmf parser + parsed information used in Pork
Expand Down
3 changes: 0 additions & 3 deletions PorkParserWin/test.pmf
Expand Up @@ -55,9 +55,6 @@ def map mMountain:
something[3] # Put three of this object in the world
whatever[0] # Put an infinite amount of objects in world
eset
set itemDTag for something "There is a something here as well."
set itemDTag for potato "And on the table there " + p("is", "are") + curItemAmt() + "potato" + p("es") + "!"
set itemDTag for whatever "You notice a whole pile of whatever."
set dir.s mChina
set dir.e mGreg
set dir.d mMap
Expand Down

0 comments on commit 4084747

Please sign in to comment.