From 621d0f09fafba69aa650bc1555927f41e9c8e60e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 3 May 2007 22:21:05 +0000 Subject: Update PokeMod to PokeGen::PokeMod git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@6 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Matrix.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'pokemod/Matrix.cpp') diff --git a/pokemod/Matrix.cpp b/pokemod/Matrix.cpp index 96550a25..0d133783 100644 --- a/pokemod/Matrix.cpp +++ b/pokemod/Matrix.cpp @@ -24,7 +24,7 @@ #include "Matrix.h" template -PokeMod::Matrix::Matrix(unsigned w, unsigned h, T &d) +PokeGen::PokeMod::Matrix::Matrix(unsigned w, unsigned h, T &d) { matrix.resize(w, std::vector(h, d)); width = w; @@ -32,13 +32,13 @@ PokeMod::Matrix::Matrix(unsigned w, unsigned h, T &d) } template -PokeMod::Matrix::Matrix(XmlElement &x) +PokeGen::PokeMod::Matrix::Matrix(XmlElement &x) { ImportXml(xml); } template -void PokeMod::Matrix::AddRow(T &d) +void PokeGen::PokeMod::Matrix::AddRow(T &d) { for (std::vector *i = matrix.begin(); i != matrix.end(); ++i) i->push_back(d); @@ -46,7 +46,7 @@ void PokeMod::Matrix::AddRow(T &d) } template -void PokeMod::Matrix::ImportXml(XmlElement &xml) +void PokeGen::PokeMod::Matrix::ImportXml(XmlElement &xml) { LogImportStart("Matrix"); String curName; @@ -108,7 +108,7 @@ void PokeMod::Matrix::ImportXml(XmlElement &xml) } template -PokeMod::XmlElement PokeMod::Matrix::ExportXml(const String &val) +PokeGen::PokeMod::XmlElement PokeGen::PokeMod::Matrix::ExportXml(const String &val) { Log(String("Matrix Export: Starting %s", val.c_str()), PM_DEBUG_INFO); // Declare the elements @@ -130,14 +130,14 @@ PokeMod::XmlElement PokeMod::Matrix::ExportXml(const String &val) } template -void PokeMod::Matrix::AddCol(T &d) +void PokeGen::PokeMod::Matrix::AddCol(T &d) { matrix.push_back(std::vector(GetHeight(), d)); ++width; } template -bool PokeMod::Matrix::InsertRow(unsigned pos, T &d) +bool PokeGen::PokeMod::Matrix::InsertRow(unsigned pos, T &d) { if (height < pos) return false; @@ -148,7 +148,7 @@ bool PokeMod::Matrix::InsertRow(unsigned pos, T &d) } template -bool PokeMod::Matrix::InsertCol(unsigned pos, T &d) +bool PokeGen::PokeMod::Matrix::InsertCol(unsigned pos, T &d) { if (width < pos) return false; @@ -158,7 +158,7 @@ bool PokeMod::Matrix::InsertCol(unsigned pos, T &d) } template -bool PokeMod::Matrix::DeleteRow(unsigned pos) +bool PokeGen::PokeMod::Matrix::DeleteRow(unsigned pos) { if (height <= pos) return false; @@ -169,7 +169,7 @@ bool PokeMod::Matrix::DeleteRow(unsigned pos) } template -bool PokeMod::Matrix::DeleteCol(unsigned pos) +bool PokeGen::PokeMod::Matrix::DeleteCol(unsigned pos) { if (width <= pos) return false; @@ -179,7 +179,7 @@ bool PokeMod::Matrix::DeleteCol(unsigned pos) } template -bool PokeMod::Matrix::Set(unsigned row, unsigned col, T &s) +bool PokeGen::PokeMod::Matrix::Set(unsigned row, unsigned col, T &s) { if ((width <= col) || (height <= col)) return false; @@ -188,7 +188,7 @@ bool PokeMod::Matrix::Set(unsigned row, unsigned col, T &s) } template -T PokeMod::Matrix::Get(unsigned row, unsigned col) +T PokeGen::PokeMod::Matrix::Get(unsigned row, unsigned col) { if ((width <= col) || (height <= col)) return T(); @@ -196,7 +196,7 @@ T PokeMod::Matrix::Get(unsigned row, unsigned col) } template -std::vector PokeMod::Matrix::GetRow(unsigned row) +std::vector PokeGen::PokeMod::Matrix::GetRow(unsigned row) { std::vector r; for (std::vector *i = matrix.begin(); i != matrix.end(); ++i) @@ -205,31 +205,31 @@ std::vector PokeMod::Matrix::GetRow(unsigned row) } template -std::vector PokeMod::Matrix::GetCol(unsigned col) +std::vector PokeGen::PokeMod::Matrix::GetCol(unsigned col) { return matrix[col]; } template -unsigned PokeMod::Matrix::GetHeight() +unsigned PokeGen::PokeMod::Matrix::GetHeight() { return height; } template -unsigned PokeMod::Matrix::GetWidth() +unsigned PokeGen::PokeMod::Matrix::GetWidth() { return width; } template -T PokeMod::Matrix::operator[](Point &p) +T PokeGen::PokeMod::Matrix::operator[](Point &p) { return matrix[p.GetY()][p.GetX()]; } template -std::vector PokeMod::Matrix::operator[](int col) +std::vector PokeGen::PokeMod::Matrix::operator[](int col) { return matrix[col]; } -- cgit