Core is realy wait for work and test
Aliens create, wavetrace work, towers build, aliens move - thats all by now. I think it is time to write Graphic and Network modules.
This commit is contained in:
115
Makefile
115
Makefile
@@ -1,6 +1,6 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
# Makefile for building: aliendefender
|
# Makefile for building: aliendefender
|
||||||
# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???? 28 22:43:44 2010
|
# Generated by qmake (2.01a) (Qt 4.6.2) on: ?? ???? 29 09:41:29 2010
|
||||||
# Project: aliendefender.pro
|
# Project: aliendefender.pro
|
||||||
# Template: app
|
# Template: app
|
||||||
# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
|
# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
|
||||||
@@ -49,12 +49,16 @@ SOURCES = map.cpp \
|
|||||||
towers.cpp \
|
towers.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
splashes.cpp \
|
splashes.cpp \
|
||||||
adcore.cpp moc_map.cpp \
|
adcore.cpp \
|
||||||
|
player.cpp \
|
||||||
|
settreader.cpp moc_map.cpp \
|
||||||
moc_game_data.cpp \
|
moc_game_data.cpp \
|
||||||
moc_aliens.cpp \
|
moc_aliens.cpp \
|
||||||
moc_towers.cpp \
|
moc_towers.cpp \
|
||||||
moc_splashes.cpp \
|
moc_splashes.cpp \
|
||||||
moc_adcore.cpp
|
moc_adcore.cpp \
|
||||||
|
moc_player.cpp \
|
||||||
|
qrc_images.cpp
|
||||||
OBJECTS = map.o \
|
OBJECTS = map.o \
|
||||||
game_data.o \
|
game_data.o \
|
||||||
aliens.o \
|
aliens.o \
|
||||||
@@ -62,12 +66,16 @@ OBJECTS = map.o \
|
|||||||
main.o \
|
main.o \
|
||||||
splashes.o \
|
splashes.o \
|
||||||
adcore.o \
|
adcore.o \
|
||||||
|
player.o \
|
||||||
|
settreader.o \
|
||||||
moc_map.o \
|
moc_map.o \
|
||||||
moc_game_data.o \
|
moc_game_data.o \
|
||||||
moc_aliens.o \
|
moc_aliens.o \
|
||||||
moc_towers.o \
|
moc_towers.o \
|
||||||
moc_splashes.o \
|
moc_splashes.o \
|
||||||
moc_adcore.o
|
moc_adcore.o \
|
||||||
|
moc_player.o \
|
||||||
|
qrc_images.o
|
||||||
DIST = /usr/share/qt4/mkspecs/common/g++.conf \
|
DIST = /usr/share/qt4/mkspecs/common/g++.conf \
|
||||||
/usr/share/qt4/mkspecs/common/unix.conf \
|
/usr/share/qt4/mkspecs/common/unix.conf \
|
||||||
/usr/share/qt4/mkspecs/common/linux.conf \
|
/usr/share/qt4/mkspecs/common/linux.conf \
|
||||||
@@ -167,7 +175,7 @@ qmake: FORCE
|
|||||||
|
|
||||||
dist:
|
dist:
|
||||||
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0
|
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0
|
||||||
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents base_types.h map.h game_data.h aliens.h towers.h splashes.h adcore.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents map.cpp game_data.cpp aliens.cpp towers.cpp main.cpp splashes.cpp adcore.cpp .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
|
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents base_types.h map.h game_data.h aliens.h towers.h splashes.h adcore.h player.h settreader.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents images.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents map.cpp game_data.cpp aliens.cpp towers.cpp main.cpp splashes.cpp adcore.cpp player.cpp settreader.cpp .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
|
||||||
|
|
||||||
|
|
||||||
clean:compiler_clean
|
clean:compiler_clean
|
||||||
@@ -186,47 +194,88 @@ mocclean: compiler_moc_header_clean compiler_moc_source_clean
|
|||||||
|
|
||||||
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
|
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
|
||||||
|
|
||||||
compiler_moc_header_make_all: moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp
|
compiler_moc_header_make_all: moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp
|
||||||
compiler_moc_header_clean:
|
compiler_moc_header_clean:
|
||||||
-$(DEL_FILE) moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp
|
-$(DEL_FILE) moc_map.cpp moc_game_data.cpp moc_aliens.cpp moc_towers.cpp moc_splashes.cpp moc_adcore.cpp moc_player.cpp
|
||||||
moc_map.cpp: base_types.h \
|
moc_map.cpp: base_types.h \
|
||||||
|
settreader.h \
|
||||||
map.h
|
map.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
|
||||||
|
|
||||||
moc_game_data.cpp: map.h \
|
moc_game_data.cpp: player.h \
|
||||||
|
map.h \
|
||||||
base_types.h \
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
game_data.h
|
game_data.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) game_data.h -o moc_game_data.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) game_data.h -o moc_game_data.cpp
|
||||||
|
|
||||||
moc_aliens.cpp: game_data.h \
|
moc_aliens.cpp: game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h \
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
aliens.h
|
aliens.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) aliens.h -o moc_aliens.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) aliens.h -o moc_aliens.cpp
|
||||||
|
|
||||||
moc_towers.cpp: game_data.h \
|
moc_towers.cpp: game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h \
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
towers.h
|
towers.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) towers.h -o moc_towers.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) towers.h -o moc_towers.cpp
|
||||||
|
|
||||||
moc_splashes.cpp: game_data.h \
|
moc_splashes.cpp: game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h \
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
splashes.h
|
splashes.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splashes.h -o moc_splashes.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splashes.h -o moc_splashes.cpp
|
||||||
|
|
||||||
moc_adcore.cpp: aliens.h \
|
moc_adcore.cpp: aliens.h \
|
||||||
game_data.h \
|
game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h \
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
towers.h \
|
towers.h \
|
||||||
splashes.h \
|
splashes.h \
|
||||||
adcore.h
|
adcore.h
|
||||||
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) adcore.h -o moc_adcore.cpp
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) adcore.h -o moc_adcore.cpp
|
||||||
|
|
||||||
compiler_rcc_make_all:
|
moc_player.cpp: map.h \
|
||||||
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
|
player.h
|
||||||
|
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) player.h -o moc_player.cpp
|
||||||
|
|
||||||
|
compiler_rcc_make_all: qrc_images.cpp
|
||||||
compiler_rcc_clean:
|
compiler_rcc_clean:
|
||||||
|
-$(DEL_FILE) qrc_images.cpp
|
||||||
|
qrc_images.cpp: images.qrc \
|
||||||
|
images/Aliens/Al_00_12.png \
|
||||||
|
images/Aliens/Al_00_6.png \
|
||||||
|
images/Aliens/Al_00_2.png \
|
||||||
|
images/Aliens/Al_00_17.png \
|
||||||
|
images/Aliens/Al_00_13.png \
|
||||||
|
images/Aliens/Al_00_7.png \
|
||||||
|
images/Aliens/Al_00_3.png \
|
||||||
|
images/Aliens/Al_00_18.png \
|
||||||
|
images/Aliens/Al_00_10.png \
|
||||||
|
images/Aliens/Al_00_14.png \
|
||||||
|
images/Aliens/Al_00_8.png \
|
||||||
|
images/Aliens/Al_00_4.png \
|
||||||
|
images/Aliens/Al_00_0.png \
|
||||||
|
images/Aliens/Al_00_19.png \
|
||||||
|
images/Aliens/Al_00_11.png \
|
||||||
|
images/Aliens/Al_00_15.png \
|
||||||
|
images/Aliens/Al_00_9.png \
|
||||||
|
images/Aliens/Al_00_5.png \
|
||||||
|
images/Aliens/Al_00_1.png \
|
||||||
|
images/Aliens/Al_00_16.png
|
||||||
|
/usr/bin/rcc -name images images.qrc -o qrc_images.cpp
|
||||||
|
|
||||||
compiler_image_collection_make_all: qmake_image_collection.cpp
|
compiler_image_collection_make_all: qmake_image_collection.cpp
|
||||||
compiler_image_collection_clean:
|
compiler_image_collection_clean:
|
||||||
-$(DEL_FILE) qmake_image_collection.cpp
|
-$(DEL_FILE) qmake_image_collection.cpp
|
||||||
@@ -240,49 +289,77 @@ compiler_yacc_impl_make_all:
|
|||||||
compiler_yacc_impl_clean:
|
compiler_yacc_impl_clean:
|
||||||
compiler_lex_make_all:
|
compiler_lex_make_all:
|
||||||
compiler_lex_clean:
|
compiler_lex_clean:
|
||||||
compiler_clean: compiler_moc_header_clean
|
compiler_clean: compiler_moc_header_clean compiler_rcc_clean
|
||||||
|
|
||||||
####### Compile
|
####### Compile
|
||||||
|
|
||||||
map.o: map.cpp map.h \
|
map.o: map.cpp map.h \
|
||||||
base_types.h
|
base_types.h \
|
||||||
|
settreader.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o map.o map.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o map.o map.cpp
|
||||||
|
|
||||||
game_data.o: game_data.cpp game_data.h \
|
game_data.o: game_data.cpp game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h
|
base_types.h \
|
||||||
|
settreader.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o game_data.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game_data.o game_data.cpp
|
||||||
|
|
||||||
aliens.o: aliens.cpp aliens.h \
|
aliens.o: aliens.cpp aliens.h \
|
||||||
game_data.h \
|
game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h
|
base_types.h \
|
||||||
|
settreader.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aliens.o aliens.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aliens.o aliens.cpp
|
||||||
|
|
||||||
towers.o: towers.cpp towers.h \
|
towers.o: towers.cpp towers.h \
|
||||||
game_data.h \
|
game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h
|
base_types.h \
|
||||||
|
settreader.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o towers.o towers.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o towers.o towers.cpp
|
||||||
|
|
||||||
main.o: main.cpp
|
main.o: main.cpp adcore.h \
|
||||||
|
aliens.h \
|
||||||
|
game_data.h \
|
||||||
|
player.h \
|
||||||
|
map.h \
|
||||||
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
|
towers.h \
|
||||||
|
splashes.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
|
||||||
|
|
||||||
splashes.o: splashes.cpp splashes.h \
|
splashes.o: splashes.cpp splashes.h \
|
||||||
game_data.h \
|
game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h
|
base_types.h \
|
||||||
|
settreader.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashes.o splashes.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o splashes.o splashes.cpp
|
||||||
|
|
||||||
adcore.o: adcore.cpp adcore.h \
|
adcore.o: adcore.cpp adcore.h \
|
||||||
aliens.h \
|
aliens.h \
|
||||||
game_data.h \
|
game_data.h \
|
||||||
|
player.h \
|
||||||
map.h \
|
map.h \
|
||||||
base_types.h \
|
base_types.h \
|
||||||
|
settreader.h \
|
||||||
towers.h \
|
towers.h \
|
||||||
splashes.h
|
splashes.h
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o adcore.o adcore.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o adcore.o adcore.cpp
|
||||||
|
|
||||||
|
player.o: player.cpp player.h \
|
||||||
|
map.h \
|
||||||
|
base_types.h \
|
||||||
|
settreader.h
|
||||||
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o player.o player.cpp
|
||||||
|
|
||||||
|
settreader.o: settreader.cpp settreader.h
|
||||||
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o settreader.o settreader.cpp
|
||||||
|
|
||||||
moc_map.o: moc_map.cpp
|
moc_map.o: moc_map.cpp
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
|
||||||
|
|
||||||
@@ -301,6 +378,12 @@ moc_splashes.o: moc_splashes.cpp
|
|||||||
moc_adcore.o: moc_adcore.cpp
|
moc_adcore.o: moc_adcore.cpp
|
||||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_adcore.o moc_adcore.cpp
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_adcore.o moc_adcore.cpp
|
||||||
|
|
||||||
|
moc_player.o: moc_player.cpp
|
||||||
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_player.o moc_player.cpp
|
||||||
|
|
||||||
|
qrc_images.o: qrc_images.cpp
|
||||||
|
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_images.o qrc_images.cpp
|
||||||
|
|
||||||
####### Install
|
####### Install
|
||||||
|
|
||||||
install: FORCE
|
install: FORCE
|
||||||
|
|||||||
13
adcore.cpp
13
adcore.cpp
@@ -4,13 +4,24 @@ adCore::adCore(QObject *parent) :
|
|||||||
QThread(parent)
|
QThread(parent)
|
||||||
{
|
{
|
||||||
step = 0;
|
step = 0;
|
||||||
admap = new Map(1,QSize(100,100));
|
admap = new Map(1);
|
||||||
addata = new Game_Data(admap);
|
addata = new Game_Data(admap);
|
||||||
|
Player * pl1 = new Player(0);
|
||||||
|
Player * pl2 = new Player(0);
|
||||||
|
addata->players.push_back(pl1);
|
||||||
|
addata->players.push_back(pl2);
|
||||||
adaliens = new Aliens(addata);
|
adaliens = new Aliens(addata);
|
||||||
adtowers = new Towers(addata);
|
adtowers = new Towers(addata);
|
||||||
adsplashes = new Splashes(addata);
|
adsplashes = new Splashes(addata);
|
||||||
|
connect(admap,SIGNAL(RecreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
|
||||||
|
adaliens->AddAlien(0);
|
||||||
|
adaliens->AddAlien(0);
|
||||||
|
adaliens->AddAlien(0);
|
||||||
|
for (int i=0; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++)
|
||||||
|
adtowers->AddTower(0,0,QPoint(i,i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void adCore::next()
|
void adCore::next()
|
||||||
{
|
{
|
||||||
adtowers->update();
|
adtowers->update();
|
||||||
|
|||||||
10
adcore.h
10
adcore.h
@@ -14,17 +14,17 @@ Q_OBJECT
|
|||||||
public:
|
public:
|
||||||
explicit adCore(QObject *parent = 0);
|
explicit adCore(QObject *parent = 0);
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void next();
|
|
||||||
private:
|
|
||||||
Map *admap;
|
Map *admap;
|
||||||
Game_Data *addata;
|
Game_Data *addata;
|
||||||
Aliens *adaliens;
|
Aliens *adaliens;
|
||||||
Towers *adtowers;
|
Towers *adtowers;
|
||||||
Splashes *adsplashes;
|
Splashes *adsplashes;
|
||||||
int step;
|
int step;
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void next();
|
||||||
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADCORE_H
|
#endif // ADCORE_H
|
||||||
|
|||||||
@@ -4,12 +4,19 @@ HEADERS += base_types.h \
|
|||||||
aliens.h \
|
aliens.h \
|
||||||
towers.h \
|
towers.h \
|
||||||
splashes.h \
|
splashes.h \
|
||||||
adcore.h
|
adcore.h \
|
||||||
|
player.h \
|
||||||
|
settreader.h
|
||||||
SOURCES += map.cpp \
|
SOURCES += map.cpp \
|
||||||
game_data.cpp \
|
game_data.cpp \
|
||||||
aliens.cpp \
|
aliens.cpp \
|
||||||
towers.cpp \
|
towers.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
splashes.cpp \
|
splashes.cpp \
|
||||||
adcore.cpp
|
adcore.cpp \
|
||||||
|
player.cpp \
|
||||||
|
settreader.cpp
|
||||||
RESOURCES += images.qrc
|
RESOURCES += images.qrc
|
||||||
|
OTHER_FILES += map.conf \
|
||||||
|
example16x16.map \
|
||||||
|
example16x12.map
|
||||||
|
|||||||
@@ -1,111 +1,254 @@
|
|||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
<variable>RunConfiguration0-BaseEnvironmentBase</variable>
|
||||||
|
<value type="int">2</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-CommandLineArguments</variable>
|
||||||
|
<valuelist type="QVariantList"/>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-ProFile</variable>
|
||||||
|
<value type="QString">aliendefender.pro</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-RunConfiguration.name</variable>
|
||||||
|
<value type="QString">aliendefender</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-UseDyldImageSuffix</variable>
|
||||||
|
<value type="bool">false</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-UseTerminal</variable>
|
||||||
|
<value type="bool">false</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-UserEnvironmentChanges</variable>
|
||||||
|
<valuelist type="QVariantList"/>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-UserSetName</variable>
|
||||||
|
<value type="bool">false</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-UserSetWorkingDirectory</variable>
|
||||||
|
<value type="bool">false</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-UserWorkingDirectory</variable>
|
||||||
|
<value type="QString"></value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>RunConfiguration0-type</variable>
|
||||||
|
<value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>activeRunConfiguration</variable>
|
||||||
<value type="int">0</value>
|
<value type="int">0</value>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
<variable>activebuildconfiguration</variable>
|
||||||
|
<value type="QString">Debug</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>buildConfiguration-Debug</variable>
|
||||||
<valuemap type="QVariantMap">
|
<valuemap type="QVariantMap">
|
||||||
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||||
|
<value key="QtVersionId" type="int">2</value>
|
||||||
|
<value key="ToolChain" type="int">0</value>
|
||||||
|
<value key="buildConfiguration" type="int">2</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
<variable>buildconfiguration-Debug-buildstep0</variable>
|
||||||
<valuemap type="QVariantMap">
|
<valuemap type="QVariantMap">
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</value>
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
|
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||||
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
|
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-oJVJLhEuxX,guid=dd326939f06256af8e013dce4c50f54e</value>
|
||||||
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
|
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
|
||||||
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
|
<value type="QString">DESKTOP_SESSION=gnome</value>
|
||||||
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
|
<value type="QString">DISPLAY=:0.0</value>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
<value type="QString">GDMSESSION=gnome</value>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
|
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
|
||||||
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
|
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
|
||||||
|
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
|
||||||
|
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-UECX54</value>
|
||||||
|
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
|
||||||
|
<value type="QString">HOME=/home/andrey</value>
|
||||||
|
<value type="QString">LANG=ru_RU.UTF-8</value>
|
||||||
|
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
|
||||||
|
<value type="QString">LOGNAME=andrey</value>
|
||||||
|
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
|
||||||
|
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
|
||||||
|
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
|
||||||
|
<value type="QString">PWD=/home/andrey</value>
|
||||||
|
<value type="QString">QTDIR=/usr/share/qt4</value>
|
||||||
|
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1144,unix/buull-eeePC:/tmp/.ICE-unix/1144</value>
|
||||||
|
<value type="QString">SHELL=/bin/bash</value>
|
||||||
|
<value type="QString">SPEECHD_PORT=6561</value>
|
||||||
|
<value type="QString">SSH_AGENT_PID=1178</value>
|
||||||
|
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-UECX54/ssh</value>
|
||||||
|
<value type="QString">USER=andrey</value>
|
||||||
|
<value type="QString">USERNAME=andrey</value>
|
||||||
|
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-SArBRZ/database</value>
|
||||||
|
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
|
||||||
|
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
|
||||||
|
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1280374094.93008-1317282182</value>
|
||||||
|
</valuelist>
|
||||||
|
<valuelist key="abstractProcess.arguments" type="QVariantList">
|
||||||
|
<value type="QString">/home/andrey/AD/aliendefender/aliendefender.pro</value>
|
||||||
|
<value type="QString">-spec</value>
|
||||||
|
<value type="QString">linux-g++</value>
|
||||||
|
<value type="QString">-r</value>
|
||||||
|
<value type="QString">CONFIG+=debug</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="abstractProcess.command" type="QString">/usr/bin/qmake-qt4</value>
|
||||||
|
<value key="abstractProcess.enabled" type="bool">false</value>
|
||||||
|
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
|
</data>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
<data>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
<variable>buildconfiguration-Debug-buildstep1</variable>
|
||||||
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
|
<valuemap type="QVariantMap">
|
||||||
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||||
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||||
|
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-oJVJLhEuxX,guid=dd326939f06256af8e013dce4c50f54e</value>
|
||||||
|
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
|
||||||
|
<value type="QString">DESKTOP_SESSION=gnome</value>
|
||||||
|
<value type="QString">DISPLAY=:0.0</value>
|
||||||
|
<value type="QString">GDMSESSION=gnome</value>
|
||||||
|
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
|
||||||
|
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
|
||||||
|
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
|
||||||
|
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-UECX54</value>
|
||||||
|
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
|
||||||
|
<value type="QString">HOME=/home/andrey</value>
|
||||||
|
<value type="QString">LANG=ru_RU.UTF-8</value>
|
||||||
|
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
|
||||||
|
<value type="QString">LOGNAME=andrey</value>
|
||||||
|
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
|
||||||
|
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
|
||||||
|
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
|
||||||
|
<value type="QString">PWD=/home/andrey</value>
|
||||||
|
<value type="QString">QTDIR=/usr/share/qt4</value>
|
||||||
|
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1144,unix/buull-eeePC:/tmp/.ICE-unix/1144</value>
|
||||||
|
<value type="QString">SHELL=/bin/bash</value>
|
||||||
|
<value type="QString">SPEECHD_PORT=6561</value>
|
||||||
|
<value type="QString">SSH_AGENT_PID=1178</value>
|
||||||
|
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-UECX54/ssh</value>
|
||||||
|
<value type="QString">USER=andrey</value>
|
||||||
|
<value type="QString">USERNAME=andrey</value>
|
||||||
|
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-SArBRZ/database</value>
|
||||||
|
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
|
||||||
|
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
|
||||||
|
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1280374094.93008-1317282182</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
|
||||||
|
<valuelist key="abstractProcess.arguments" type="QVariantList">
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
|
||||||
|
<value key="abstractProcess.enabled" type="bool">true</value>
|
||||||
|
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
|
</data>
|
||||||
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
|
<data>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
<variable>buildconfiguration-Debug-cleanstep0</variable>
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
<valuemap type="QVariantMap">
|
||||||
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||||
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
|
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||||
|
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-oJVJLhEuxX,guid=dd326939f06256af8e013dce4c50f54e</value>
|
||||||
|
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
|
||||||
|
<value type="QString">DESKTOP_SESSION=gnome</value>
|
||||||
|
<value type="QString">DISPLAY=:0.0</value>
|
||||||
|
<value type="QString">GDMSESSION=gnome</value>
|
||||||
|
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
|
||||||
|
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
|
||||||
|
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
|
||||||
|
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-UECX54</value>
|
||||||
|
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
|
||||||
|
<value type="QString">HOME=/home/andrey</value>
|
||||||
|
<value type="QString">LANG=ru_RU.UTF-8</value>
|
||||||
|
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
|
||||||
|
<value type="QString">LOGNAME=andrey</value>
|
||||||
|
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
|
||||||
|
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
|
||||||
|
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
|
||||||
|
<value type="QString">PWD=/home/andrey</value>
|
||||||
|
<value type="QString">QTDIR=/usr/share/qt4</value>
|
||||||
|
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1144,unix/buull-eeePC:/tmp/.ICE-unix/1144</value>
|
||||||
|
<value type="QString">SHELL=/bin/bash</value>
|
||||||
|
<value type="QString">SPEECHD_PORT=6561</value>
|
||||||
|
<value type="QString">SSH_AGENT_PID=1178</value>
|
||||||
|
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-UECX54/ssh</value>
|
||||||
|
<value type="QString">USER=andrey</value>
|
||||||
|
<value type="QString">USERNAME=andrey</value>
|
||||||
|
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-SArBRZ/database</value>
|
||||||
|
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
|
||||||
|
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
|
||||||
|
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1280374094.93008-1317282182</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
|
||||||
|
<valuelist key="abstractProcess.arguments" type="QVariantList">
|
||||||
|
<value type="QString">clean</value>
|
||||||
|
<value type="QString">-w</value>
|
||||||
|
</valuelist>
|
||||||
|
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
|
||||||
|
<value key="abstractProcess.enabled" type="bool">true</value>
|
||||||
|
<value key="abstractProcess.workingDirectory" type="QString">/home/andrey/AD/aliendefender</value>
|
||||||
|
<value key="cleanConfig" type="bool">true</value>
|
||||||
|
<valuelist key="makeargs" type="QVariantList">
|
||||||
<value type="QString">clean</value>
|
<value type="QString">clean</value>
|
||||||
</valuelist>
|
</valuelist>
|
||||||
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
|
|
||||||
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
|
|
||||||
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/peri4/pprojects/aliendefender-build-desktop</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
|
|
||||||
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
|
|
||||||
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
|
|
||||||
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
|
|
||||||
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
|
|
||||||
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
|
|
||||||
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
|
|
||||||
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
|
|
||||||
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
|
|
||||||
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/peri4/pprojects/aliendefender-build-desktop</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
|
|
||||||
</valuemap>
|
|
||||||
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
|
|
||||||
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">aliendefender</value>
|
|
||||||
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
|
|
||||||
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">aliendefender.pro</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
|
|
||||||
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
|
|
||||||
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
|
|
||||||
</valuemap>
|
</valuemap>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
<variable>buildconfigurations</variable>
|
||||||
<value type="int">1</value>
|
<valuelist type="QVariantList">
|
||||||
|
<value type="QString">Debug</value>
|
||||||
|
</valuelist>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
<variable>buildstep0</variable>
|
||||||
<value type="int">4</value>
|
<valuemap type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="mkspec" type="QString"></value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>buildstep1</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>buildsteps</variable>
|
||||||
|
<valuelist type="QVariantList">
|
||||||
|
<value type="QString">trolltech.qt4projectmanager.qmake</value>
|
||||||
|
<value type="QString">trolltech.qt4projectmanager.make</value>
|
||||||
|
</valuelist>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>cleanstep0</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
|
||||||
|
<value key="clean" type="bool">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>cleansteps</variable>
|
||||||
|
<valuelist type="QVariantList">
|
||||||
|
<value type="QString">trolltech.qt4projectmanager.make</value>
|
||||||
|
</valuelist>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>defaultFileEncoding</variable>
|
||||||
|
<value type="QByteArray">System</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>project</variable>
|
||||||
|
<valuemap type="QVariantMap"/>
|
||||||
</data>
|
</data>
|
||||||
</qtcreator>
|
</qtcreator>
|
||||||
|
|||||||
115
aliens.cpp
115
aliens.cpp
@@ -1,13 +1,126 @@
|
|||||||
#include "aliens.h"
|
#include "aliens.h"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
Aliens::Aliens(Game_Data *gd, QObject *parent) :
|
Aliens::Aliens(Game_Data *gd, QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
gameData = gd;
|
gameData = gd;
|
||||||
|
nextId = 0;
|
||||||
|
Alien al;
|
||||||
|
al.speed = 0.1f;
|
||||||
|
al.health = 10;
|
||||||
|
al.type = 0;
|
||||||
|
gameData->srcAliens.push_back(al);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Aliens::AddAlien(int srcId)
|
||||||
|
{
|
||||||
|
if (srcId < 0 || srcId >= gameData->srcAliens.size()) qDebug("ERROR out of aliens range"),exit(-1);
|
||||||
|
Alien al = gameData->srcAliens.at(srcId);
|
||||||
|
al.Id = nextId;
|
||||||
|
al.finish = gameData->map->finishs.at(qrand()%gameData->map->finishs.size());
|
||||||
|
qDebug()<<gameData->map->finishs.size()<<qrand()%gameData->map->finishs.size();
|
||||||
|
al.pos = QPointF(gameData->map->starts.at(qrand()%gameData->map->starts.size()));
|
||||||
|
al.path = gameData->map->CreatePath(al.pos.toPoint(),al.finish);
|
||||||
|
al.pathIndex = 1;
|
||||||
|
if (al.path.isEmpty()) qDebug("ERROR create path"),exit(-1);
|
||||||
|
qDebug() << al.path;
|
||||||
|
gameData->map->printMap();
|
||||||
|
nextId++;
|
||||||
|
gameData->curAliens.push_back(al);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Aliens::retrace(bool *OK)
|
||||||
|
{
|
||||||
|
qDebug("retarce!");
|
||||||
|
for (int i=0; i<gameData->curAliens.size(); i++)
|
||||||
|
{
|
||||||
|
Alien al = gameData->curAliens.at(i);
|
||||||
|
al.path = gameData->map->CreatePath(al.pos.toPoint(),al.finish);
|
||||||
|
al.pathIndex = 1;
|
||||||
|
if (al.path.isEmpty()) *OK = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Aliens::DelAlien(int index)
|
||||||
|
{
|
||||||
|
gameData->curAliens.remove(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Aliens::DelAlienById(int Id)
|
||||||
|
{
|
||||||
|
DelAlien(AlienIndex(Id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Aliens::AlienIndex(int alienId)
|
||||||
|
{
|
||||||
|
int i=-1;
|
||||||
|
for (i=0; i<gameData->curAliens.size(); i++)
|
||||||
|
if (gameData->curAliens.at(i).Id==alienId) return i;
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Aliens::update()
|
void Aliens::update()
|
||||||
{
|
{
|
||||||
|
QVector <int> missIndex;
|
||||||
|
for (int i=0; i<gameData->curAliens.size(); i++)
|
||||||
|
{
|
||||||
|
Alien al = gameData->curAliens.at(i);
|
||||||
|
qDebug() << i;
|
||||||
|
//if (al.health < 0) emit AlienKill();
|
||||||
|
float tmpdx,tmpdy,angl,arctg = 0;
|
||||||
|
qDebug() << "path index" << al.pathIndex;
|
||||||
|
tmpdx = al.pos.x() - al.path.at(al.pathIndex).x();
|
||||||
|
tmpdy = al.pos.y() - al.path.at(al.pathIndex).y();
|
||||||
|
while (std::sqrt(tmpdx*tmpdx +tmpdy*tmpdy) < 2*al.speed)
|
||||||
|
{
|
||||||
|
al.pathIndex++;
|
||||||
|
if (al.pathIndex >= al.path.size())
|
||||||
|
{
|
||||||
|
qDebug("Missing alien!");
|
||||||
|
missIndex.push_back(al.Id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/*{
|
||||||
|
PathIndex = 0;
|
||||||
|
position = game->start*game->cellsize;
|
||||||
|
}*/
|
||||||
|
tmpdx = al.pos.x() - al.path.at(al.pathIndex).x();
|
||||||
|
tmpdy = al.pos.y() - al.path.at(al.pathIndex).y();
|
||||||
|
//qDebug() << "next";
|
||||||
|
}
|
||||||
|
arctg = std::atan(tmpdx/tmpdy);
|
||||||
|
if (tmpdy < 0) arctg=arctg+M_PI;
|
||||||
|
angl = 180.0f*(-arctg)/M_PI;
|
||||||
|
/*if (PathIndex > 1)
|
||||||
|
{
|
||||||
|
if ((Position.angle-angl < -5 || Position.angle-angl > 5) && angl < 175 && angl > -175)
|
||||||
|
{
|
||||||
|
if (angl > Position.angle) Position.angle += 5;
|
||||||
|
else Position.angle -= 5;
|
||||||
|
}
|
||||||
|
else Position.angle = angl;
|
||||||
|
}
|
||||||
|
else*/
|
||||||
|
al.angle = angl;
|
||||||
|
//qDebug() << "[" << PathIndex << ";" << PicIndex << "]" << "angle:" << Position.angle << "arctg:" << arctg << "Pos:" << Position.pnt;
|
||||||
|
al.pos.setX(al.pos.x()
|
||||||
|
-al.speed*std::sin(arctg));
|
||||||
|
al.pos.setY(al.pos.y()
|
||||||
|
-al.speed*std::cos(arctg));
|
||||||
|
//return true;
|
||||||
|
gameData->curAliens[i] = al;
|
||||||
|
}
|
||||||
|
for (int j=0; j<missIndex.size(); j++)
|
||||||
|
{
|
||||||
|
gameData->missingAliens++;
|
||||||
|
DelAlienById(missIndex.at(j));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
aliens.h
11
aliens.h
@@ -12,20 +12,21 @@ Q_OBJECT
|
|||||||
public:
|
public:
|
||||||
explicit Aliens(Game_Data * gd, QObject *parent = 0);
|
explicit Aliens(Game_Data * gd, QObject *parent = 0);
|
||||||
void AddAlien(int srcId);
|
void AddAlien(int srcId);
|
||||||
void DelAlienById(int Id);
|
|
||||||
void DelAlien(int index);
|
|
||||||
void retrace();
|
|
||||||
void nextWave();
|
void nextWave();
|
||||||
void update();
|
void update();
|
||||||
|
int AlienIndex(int alienId);
|
||||||
int size() const {return gameData->curAliens.size();}
|
int size() const {return gameData->curAliens.size();}
|
||||||
signals:
|
signals:
|
||||||
void AlienFinish();
|
|
||||||
public slots:
|
public slots:
|
||||||
//void getDamage(float dmg);
|
void DelAlienById(int Id);
|
||||||
|
void DelAlien(int index);
|
||||||
|
void retrace(bool * OK);
|
||||||
private:
|
private:
|
||||||
Game_Data * gameData;
|
Game_Data * gameData;
|
||||||
QPointF globStart;
|
QPointF globStart;
|
||||||
QPointF globFinish;
|
QPointF globFinish;
|
||||||
|
int nextId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ALIENS_H
|
#endif // ALIENS_H
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ struct Alien
|
|||||||
float health;
|
float health;
|
||||||
QPoint finish;
|
QPoint finish;
|
||||||
QVector <QPointF> path;
|
QVector <QPointF> path;
|
||||||
|
int pathIndex;
|
||||||
unsigned int gold;
|
unsigned int gold;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -23,10 +24,11 @@ struct Tower
|
|||||||
int Id;
|
int Id;
|
||||||
int type;
|
int type;
|
||||||
int AlienId; // aim alien
|
int AlienId; // aim alien
|
||||||
|
int PlayerId; // tower's owner
|
||||||
QPoint pos; // not QPointF because tower fixed on grid
|
QPoint pos; // not QPointF because tower fixed on grid
|
||||||
float angle; // -180 .. 180
|
float angle; // -180 .. 180
|
||||||
float range;
|
float range;
|
||||||
float speed; // shots per tick (e.g. speed=1 is 60 shots by 1sec for 60fps e.g. )
|
float reload; // time for reload in ticks
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
example16x12.map
Normal file
BIN
example16x12.map
Normal file
Binary file not shown.
BIN
example16x16.map
Normal file
BIN
example16x16.map
Normal file
Binary file not shown.
@@ -4,4 +4,6 @@ Game_Data::Game_Data(Map *mapp, QObject *parent) :
|
|||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
map = mapp;
|
map = mapp;
|
||||||
|
curWave = 0;
|
||||||
|
missingAliens = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "map.h"
|
#include "player.h"
|
||||||
|
|
||||||
class Game_Data : public QObject
|
class Game_Data : public QObject
|
||||||
{
|
{
|
||||||
@@ -12,19 +12,16 @@ public:
|
|||||||
explicit Game_Data(Map * map, QObject *parent = 0);
|
explicit Game_Data(Map * map, QObject *parent = 0);
|
||||||
QVector <Alien> srcAliens;
|
QVector <Alien> srcAliens;
|
||||||
QVector <Alien> curAliens;
|
QVector <Alien> curAliens;
|
||||||
QVector <Tower> srcTowers;
|
|
||||||
QVector <Tower> curTowers;
|
QVector <Tower> curTowers;
|
||||||
QVector <Splash> srcSplashes;
|
|
||||||
QVector <Splash> curSplashes;
|
QVector <Splash> curSplashes;
|
||||||
QVector <Wave> waves;
|
QVector <Wave> waves;
|
||||||
QVector<unsigned long int> adMoney; // vector because of many players
|
QVector <Player *> players;
|
||||||
QVector<int> selectAlienId; // same reason
|
|
||||||
Map * map;
|
Map * map;
|
||||||
int curWave;
|
int curWave;
|
||||||
|
int missingAliens;
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GAME_DATA_H
|
#endif // GAME_DATA_H
|
||||||
|
|||||||
4
main.cpp
4
main.cpp
@@ -1,5 +1,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "adcore.h"
|
#include "adcore.h"
|
||||||
|
|
||||||
@@ -7,5 +8,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
adCore core;
|
adCore core;
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
QTimer * timer = new QTimer();
|
||||||
|
QObject::connect(timer,SIGNAL(timeout()),&core,SLOT(next()));
|
||||||
|
timer->start(100);
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
369
map.cpp
369
map.cpp
@@ -1,7 +1,374 @@
|
|||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
Map::Map(int Id, QSize size, QObject *parent) :
|
Map::Map(int Id, QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
mapId=Id;
|
mapId=Id;
|
||||||
|
ReadSettings();
|
||||||
|
//CreateMapExample();
|
||||||
|
for (int i=0; i<Cells.size(); i++)
|
||||||
|
{
|
||||||
|
for (int j=0; j<Cells[i].size(); j++)
|
||||||
|
{
|
||||||
|
if (Cells[i][j]==Start) starts.push_back(QPoint(i,j));
|
||||||
|
if (Cells[i][j]==Finish) finishs.push_back(QPoint(i,j));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (starts.isEmpty() || finishs.isEmpty()) qDebug("invalid map, not found start/finish"),exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Map::ReadSettings()
|
||||||
|
{
|
||||||
|
QString str;
|
||||||
|
SettingsReader * sreader = new SettingsReader("map.conf");
|
||||||
|
str = sreader->getValue("cells path");
|
||||||
|
maxPlayers = sreader->getValue("max players","1").toInt();
|
||||||
|
QFile * f = new QFile(str);
|
||||||
|
f->open(QIODevice::ReadOnly);
|
||||||
|
QDataStream s(f);
|
||||||
|
s >> Cells;
|
||||||
|
if (Cells.size()>0)
|
||||||
|
{
|
||||||
|
mapsize.setWidth(Cells.size());
|
||||||
|
mapsize.setHeight(Cells[0].size());
|
||||||
|
qDebug() << "Map size" << mapsize;
|
||||||
|
printMap();
|
||||||
|
} else qDebug("invalid size");
|
||||||
|
delete f;
|
||||||
|
delete sreader;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Map::printMap()
|
||||||
|
{
|
||||||
|
for (int i=0; i<Cells.size(); i++) qDebug()<<Cells.at(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Map::addTowerOnMap(int playerId, QPoint pos)
|
||||||
|
{
|
||||||
|
if (playerId < 0 || playerId > maxPlayers) return false;
|
||||||
|
QRect r(QPoint(),mapsize);
|
||||||
|
if (!r.contains(pos)) return false;
|
||||||
|
if (Cells[pos.x()][pos.y()]==Player+playerId)
|
||||||
|
{
|
||||||
|
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (Cells[pos.x()][pos.y()]==PlayerAlien+playerId)
|
||||||
|
{
|
||||||
|
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
|
||||||
|
bool ok=true;
|
||||||
|
for (int i=0; i<starts.size(); i++)
|
||||||
|
for (int j=0; j<finishs.size(); j++)
|
||||||
|
if (WaveTrace(starts.at(i),finishs.at(j))<0) ok = false;
|
||||||
|
qDebug()<<"ok="<<ok;
|
||||||
|
if (!ok)
|
||||||
|
{
|
||||||
|
Cells[pos.x()][pos.y()]=PlayerAlien+playerId;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//Cells[pos.x()][pos.y()]=PlayerTower-playerId;
|
||||||
|
bool * pathOK;
|
||||||
|
pathOK = new bool();
|
||||||
|
*pathOK = true;
|
||||||
|
qDebug("emit");
|
||||||
|
emit RecreateAlienPath(pathOK);
|
||||||
|
qDebug() << *pathOK;
|
||||||
|
if (!pathOK)
|
||||||
|
{
|
||||||
|
Cells[pos.x()][pos.y()]=PlayerAlien+playerId;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
qDebug()<<"Dont buid here" << Cells[pos.x()][pos.y()];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Map::CreateMapExample()
|
||||||
|
{
|
||||||
|
Cells.resize(16);
|
||||||
|
for (int i=0; i<Cells.size(); i++)
|
||||||
|
{
|
||||||
|
Cells[i].resize(16);
|
||||||
|
Cells[i][0]=Wall;
|
||||||
|
Cells[i][Cells[i].size()-1]=Wall;
|
||||||
|
}
|
||||||
|
for (int i=0; i<Cells.size(); i++)
|
||||||
|
{
|
||||||
|
for (int j=0; j<Cells[i].size(); j++)
|
||||||
|
{
|
||||||
|
Cells[0][j]=Wall;
|
||||||
|
Cells[Cells.size()-1][j]=Wall;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i=1; i<Cells.size()/2; i++)
|
||||||
|
for (int j=1; j<Cells[i].size()-1; j++)
|
||||||
|
Cells[i][j]=Player;
|
||||||
|
for (int i=Cells.size()/2; i<Cells.size()-1; i++)
|
||||||
|
for (int j=1; j<Cells[i].size()-1; j++)
|
||||||
|
Cells[i][j]=Player+1;
|
||||||
|
for (int i=2; i<Cells.size()-2; i++)
|
||||||
|
Cells[i][Cells[i].size()/2] = Wall;
|
||||||
|
Cells[Cells.size()/2][0]=Start;
|
||||||
|
Cells[Cells.size()/2-1][0]=Start;
|
||||||
|
Cells[Cells.size()/2][Cells[Cells.size()/2].size()-1]=Finish;
|
||||||
|
Cells[Cells.size()/2-1][Cells[Cells.size()/2].size()-1]=Finish;
|
||||||
|
QFile * f = new QFile("example16x16.map");
|
||||||
|
f->open(QIODevice::ReadWrite);
|
||||||
|
QDataStream s(f);
|
||||||
|
s << Cells;
|
||||||
|
delete f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVector<QPointF> Map::CreatePath(QPoint start, QPoint finish)
|
||||||
|
{
|
||||||
|
QPointF tp;
|
||||||
|
QVector<QPoint> srcPath;
|
||||||
|
QVector<QPointF> tmpPath;
|
||||||
|
QVector<QPointF> path;
|
||||||
|
//PathIndex = 1;
|
||||||
|
if (Cells[start.x()][start.y()] < 0) qDebug("ERROR invalid start"),exit(-1);
|
||||||
|
if (Cells[finish.x()][finish.y()] < 0) qDebug("ERROR invalid finish"),exit(-1);
|
||||||
|
srcPath = InvWaveTrace(finish,WaveTrace(start,finish));
|
||||||
|
for (int i=0; i<srcPath.size();i++)
|
||||||
|
{
|
||||||
|
int x = Cells.at(srcPath.at(i).x()).at(srcPath.at(i).y());
|
||||||
|
if (x > 0 && x < 1000) x = x+1000;
|
||||||
|
Cells[srcPath.at(i).x()][srcPath.at(i).y()] = x;
|
||||||
|
tmpPath.push_back(QPointF(srcPath.at(i)));
|
||||||
|
}
|
||||||
|
srcPath.clear();
|
||||||
|
//qDebug() << tmpPath.size();
|
||||||
|
if (!tmpPath.isEmpty())
|
||||||
|
{
|
||||||
|
for (int j=0; j<4; j++)
|
||||||
|
{
|
||||||
|
path.clear();
|
||||||
|
tp = tmpPath.at(0);
|
||||||
|
path.push_back(tp);
|
||||||
|
for (int i = 0; i < tmpPath.size() - 1; i++)
|
||||||
|
{
|
||||||
|
//if (j > 1) path.push_back(tmpPath[i]);
|
||||||
|
tp.setX((tmpPath.at(i).x() + tmpPath.at(i + 1).x()) / 2.0);
|
||||||
|
tp.setY((tmpPath.at(i).y() + tmpPath.at(i + 1).y()) / 2.0);
|
||||||
|
path.push_back(tp);
|
||||||
|
}
|
||||||
|
tp = tmpPath.at(tmpPath.size() - 1);
|
||||||
|
path.push_back(tp);
|
||||||
|
tmpPath = path;
|
||||||
|
}
|
||||||
|
tmpPath.clear();
|
||||||
|
if (path.size() >= 6)
|
||||||
|
{
|
||||||
|
path.remove(1);
|
||||||
|
path.remove(1);
|
||||||
|
path.remove(path.size()-2);
|
||||||
|
path.remove(path.size()-2);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
path.clear();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Map::WaveTrace(QPoint start, QPoint finish)
|
||||||
|
{
|
||||||
|
bool stop = false;
|
||||||
|
int step = 2;
|
||||||
|
QPoint cp, tp;
|
||||||
|
QRect fr(QPoint(), mapsize);
|
||||||
|
QVector<QPoint> tmpp, curp;
|
||||||
|
TmpCells << Cells;
|
||||||
|
for (int i = 0; i < Cells.size(); i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < Cells.at(i).size(); j++)
|
||||||
|
{
|
||||||
|
if (Cells[i][j] < 0 ) TmpCells[i][j] = -1;
|
||||||
|
else TmpCells[i][j] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cp = start;
|
||||||
|
curp.push_back(cp);
|
||||||
|
TmpCells[cp.x()][cp.y()] = 1;
|
||||||
|
//qDebug() << "trace";
|
||||||
|
while (!stop) {
|
||||||
|
tmpp = curp;
|
||||||
|
curp.clear();
|
||||||
|
stop = true;
|
||||||
|
for (int i = 0; i < tmpp.size(); i++) {
|
||||||
|
cp = tmpp.at(i);
|
||||||
|
if (cp == finish) {
|
||||||
|
TmpCells[cp.x()][cp.y()] = step;
|
||||||
|
//qDebug() << "trace done!";
|
||||||
|
return step;
|
||||||
|
}
|
||||||
|
tp.setX(cp.x() - 1);
|
||||||
|
tp.setY(cp.y());
|
||||||
|
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
|
||||||
|
TmpCells[tp.x()][tp.y()] = step;
|
||||||
|
curp.push_back(tp);
|
||||||
|
stop = false;
|
||||||
|
}
|
||||||
|
tp.setX(cp.x() + 1);
|
||||||
|
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
|
||||||
|
TmpCells[tp.x()][tp.y()] = step;
|
||||||
|
curp.push_back(tp);
|
||||||
|
stop = false;
|
||||||
|
}
|
||||||
|
tp.setX(cp.x());
|
||||||
|
tp.setY(cp.y() - 1);
|
||||||
|
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
|
||||||
|
TmpCells[tp.x()][tp.y()] = step;
|
||||||
|
curp.push_back(tp);
|
||||||
|
stop = false;
|
||||||
|
}
|
||||||
|
tp.setY(cp.y() + 1);
|
||||||
|
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
|
||||||
|
TmpCells[tp.x()][tp.y()] = step;
|
||||||
|
curp.push_back(tp);
|
||||||
|
stop = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
step++;
|
||||||
|
}
|
||||||
|
//qDebug() << "trace false";
|
||||||
|
qDebug() << TmpCells;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVector<QPoint> Map::InvWaveTrace(QPoint finish, int cnt)
|
||||||
|
{
|
||||||
|
QPoint wp, Ppnt;
|
||||||
|
QVector<QPoint> alpath;
|
||||||
|
if (cnt < 2) return alpath;
|
||||||
|
int Ind, c, xpp, ypp, xnn, ynn;
|
||||||
|
unsigned char chk;
|
||||||
|
Ppnt = wp = finish;
|
||||||
|
xnn=0;
|
||||||
|
xpp=0;
|
||||||
|
ynn=0;
|
||||||
|
ypp=0;
|
||||||
|
cnt--;
|
||||||
|
alpath.push_front(Ppnt);
|
||||||
|
while (cnt > 1)
|
||||||
|
{
|
||||||
|
cnt--;
|
||||||
|
chk = 0;
|
||||||
|
Ind = 0;
|
||||||
|
c = 0;
|
||||||
|
if (wp.x() - 1 >= 0 && TmpCells[wp.x()-1][wp.y()] == cnt)
|
||||||
|
{
|
||||||
|
chk = chk | 0x01;
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
if (wp.x() + 1 < mapsize.width() && TmpCells[wp.x()+1][wp.y()] == cnt)
|
||||||
|
{
|
||||||
|
chk = chk | 0x02;
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
if (wp.y() - 1 >= 0 && TmpCells[wp.x()][wp.y()-1] == cnt)
|
||||||
|
{
|
||||||
|
chk = chk | 0x04;
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
if (wp.y() + 1 < mapsize.height() && TmpCells[wp.x()][wp.y()+1] == cnt)
|
||||||
|
{
|
||||||
|
chk = chk | 0x08;
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
if (c == 0 || chk == 0) qDebug("ERROR in InvWaveTrace"),exit(-1);
|
||||||
|
if (c > 1)
|
||||||
|
{
|
||||||
|
if ((chk & 0x01)==0x01 && (chk & 0x04)==0x04)
|
||||||
|
{
|
||||||
|
if (xnn <= ynn && Ind == 0){
|
||||||
|
wp.rx()--;
|
||||||
|
xnn++;
|
||||||
|
if (xnn == ynn) xnn++;
|
||||||
|
Ind = 1;
|
||||||
|
} else if (Ind == 0) {
|
||||||
|
wp.ry()--;
|
||||||
|
ynn++;
|
||||||
|
ynn++;
|
||||||
|
Ind = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((chk & 0x02)==0x02 && (chk & 0x04)==0x04)
|
||||||
|
{
|
||||||
|
if (xpp <= ynn && Ind == 0){
|
||||||
|
wp.rx()++;
|
||||||
|
xpp++;
|
||||||
|
if (xpp == ynn) xpp++;
|
||||||
|
Ind = 1;
|
||||||
|
} else if (Ind == 0) {
|
||||||
|
wp.ry()--;
|
||||||
|
ynn++;
|
||||||
|
ynn++;
|
||||||
|
Ind = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((chk & 0x01)==0x01 && (chk & 0x08)==0x08)
|
||||||
|
{
|
||||||
|
if (xnn <= ypp && Ind == 0){
|
||||||
|
wp.rx()--;
|
||||||
|
xnn++;
|
||||||
|
if (xnn == ypp) xnn++;
|
||||||
|
Ind = 1;
|
||||||
|
} else if (Ind == 0) {
|
||||||
|
wp.ry()++;
|
||||||
|
ypp++;
|
||||||
|
ypp++;
|
||||||
|
Ind = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((chk & 0x02)==0x02 && (chk & 0x08)==0x08)
|
||||||
|
{
|
||||||
|
if (xpp <= ypp && Ind == 0){
|
||||||
|
wp.rx()++;
|
||||||
|
xpp++;
|
||||||
|
if (xpp == ypp) xpp++;
|
||||||
|
Ind = 1;
|
||||||
|
} else if (Ind == 0) {
|
||||||
|
wp.ry()++;
|
||||||
|
ypp++;
|
||||||
|
ypp++;
|
||||||
|
Ind = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (c == 1 || Ind == 0)
|
||||||
|
{
|
||||||
|
xnn=0;
|
||||||
|
xpp=0;
|
||||||
|
ynn=0;
|
||||||
|
ypp=0;
|
||||||
|
if ((chk & 0x01)==0x01) {
|
||||||
|
wp.rx()--;
|
||||||
|
xnn++;
|
||||||
|
}
|
||||||
|
else if ((chk & 0x02)==0x02) {
|
||||||
|
wp.rx()++;
|
||||||
|
xpp++;
|
||||||
|
}
|
||||||
|
else if ((chk & 0x04)==0x04) {
|
||||||
|
wp.ry()--;
|
||||||
|
ynn++;
|
||||||
|
}
|
||||||
|
else if ((chk & 0x08)==0x08) {
|
||||||
|
wp.ry()++;
|
||||||
|
ypp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ppnt = wp;
|
||||||
|
alpath.push_front(Ppnt);
|
||||||
|
}
|
||||||
|
return alpath;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
48
map.h
48
map.h
@@ -5,26 +5,62 @@
|
|||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
#include "base_types.h"
|
#include "base_types.h"
|
||||||
|
#include "settreader.h"
|
||||||
|
|
||||||
class Map : public QObject
|
class Map : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Map(int Id, QSize size, QObject *parent = 0);
|
|
||||||
|
enum CellType
|
||||||
|
{
|
||||||
|
Player = 1,
|
||||||
|
PlayerAlien = 1001,
|
||||||
|
PlayerTower = -1,
|
||||||
|
Wall = -1000,
|
||||||
|
Start = 9999,
|
||||||
|
Finish = 8888
|
||||||
|
};
|
||||||
|
// 1 - free for player 1
|
||||||
|
// 2 - free for player 2
|
||||||
|
// 3 - -/-
|
||||||
|
// 1001 - player 1, free, but it is alien path (for optimization)
|
||||||
|
// 1002 - -/-
|
||||||
|
// 99999 - start field or finish field
|
||||||
|
// -1 - player 1 tower
|
||||||
|
// -2 - player 2 tower
|
||||||
|
// -3 - -/-
|
||||||
|
// -1000 - it is wall or some place where you can't build
|
||||||
|
|
||||||
|
QVector < QVector <int> > Cells;
|
||||||
|
QVector < QVector <int> > TmpCells;
|
||||||
|
QVector <QPoint> starts;
|
||||||
|
QVector <QPoint> finishs;
|
||||||
|
QSize mapsize;
|
||||||
|
int maxPlayers;
|
||||||
|
|
||||||
|
explicit Map(int Id, QObject *parent = 0);
|
||||||
int Id() const {return mapId;}
|
int Id() const {return mapId;}
|
||||||
int addTowerOnMap();
|
bool addTowerOnMap(int playerId, QPoint pos);
|
||||||
int delTowerOnMap();
|
void delTowerOnMap(QPoint pos);
|
||||||
QVector <QPointF> CreatePath(QPoint start, QPoint finish);
|
QVector <QPointF> CreatePath(QPoint start, QPoint finish);
|
||||||
|
QSize size() const {return mapsize;}
|
||||||
|
void ReadSettings();
|
||||||
signals:
|
signals:
|
||||||
void RecreateAlienPath();
|
void RecreateAlienPath(bool * pathOK);
|
||||||
public slots:
|
public slots:
|
||||||
|
void printMap();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int **Cells;
|
|
||||||
int mapId;
|
int mapId;
|
||||||
|
|
||||||
|
QVector<QPoint> InvWaveTrace(QPoint finish, int cnt);
|
||||||
|
int WaveTrace(QPoint start, QPoint finish);
|
||||||
|
void CreateMapExample();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAP_H
|
#endif // MAP_H
|
||||||
|
|||||||
8
player.cpp
Normal file
8
player.cpp
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include "player.h"
|
||||||
|
|
||||||
|
Player::Player(int Id, QObject *parent) :
|
||||||
|
QObject(parent)
|
||||||
|
{
|
||||||
|
playerId = Id;
|
||||||
|
adMoney = 100;
|
||||||
|
}
|
||||||
25
player.h
Normal file
25
player.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef PLAYER_H
|
||||||
|
#define PLAYER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "map.h"
|
||||||
|
|
||||||
|
class Player : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit Player(int Id, QObject *parent = 0);
|
||||||
|
unsigned long int adMoney;
|
||||||
|
int selectAlienId;
|
||||||
|
QVector <Tower> srcTowers;
|
||||||
|
QVector <Splash> srcSplashes;
|
||||||
|
int playerId;
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PLAYER_H
|
||||||
254
settreader.cpp
Normal file
254
settreader.cpp
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
#include <settreader.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
SettingsReader::SettingsReader(const QString & fname) {
|
||||||
|
isFile = true;
|
||||||
|
file = new QFile(fname);
|
||||||
|
file->open(QIODevice::ReadWrite);
|
||||||
|
stream = new QTextStream(file);
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SettingsReader::SettingsReader(QString * string) {
|
||||||
|
isFile = false;
|
||||||
|
str = string;
|
||||||
|
stream = new QTextStream(string);
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SettingsReader::~SettingsReader() {
|
||||||
|
settname.clear();
|
||||||
|
settval.clear();
|
||||||
|
settcom.clear();
|
||||||
|
setttab.clear();
|
||||||
|
settlines.clear();
|
||||||
|
setttype.clear();
|
||||||
|
all.clear();
|
||||||
|
stream->setDevice(0);
|
||||||
|
delete stream;
|
||||||
|
if (isFile) {
|
||||||
|
file->close();
|
||||||
|
delete file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString SettingsReader::getValue(QString vname, QString def, bool * exist) {
|
||||||
|
for (int i = 0; i < settname.size(); i++) {
|
||||||
|
if (settname.at(i) == vname) {
|
||||||
|
if (exist != 0) *exist = true;
|
||||||
|
return settval.at(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (exist != 0) *exist = false;
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::addLine(const QString & name, const QString & value, const QString & type) {
|
||||||
|
if (setttab.size() > 0 && all.size() > 0) *stream << setttab.at(setttab.size() - 1) << name << " = " << value << " #" << type << endl;
|
||||||
|
else *stream << name << " = " << value << " #" << type << endl;
|
||||||
|
settname.append(name);
|
||||||
|
settval.append(value);
|
||||||
|
settcom.append("");
|
||||||
|
setttype.append(type);
|
||||||
|
if (setttab.size() > 0) setttab.append(setttab.at(setttab.size() - 1));
|
||||||
|
else setttab.append(" ");
|
||||||
|
settlines.push_back(all.size());
|
||||||
|
all.append(name + " = " + value + " #" + type);
|
||||||
|
stream->flush();
|
||||||
|
if (isFile) file->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::insertLine(int number, const QString & name, const QString & value, const QString & type) {
|
||||||
|
if (number >= settname.size()) {
|
||||||
|
addLine(name, value, type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
settname.insert(number, name);
|
||||||
|
settval.insert(number, value);
|
||||||
|
settcom.insert(number, "");
|
||||||
|
setttab.insert(number, setttab.at(number));
|
||||||
|
setttype.insert(number, type);
|
||||||
|
settlines.insert(number, settlines.at(number));
|
||||||
|
for (int i = number + 1; i < settlines.size(); i++) settlines[i]++;
|
||||||
|
all.insert(settlines.at(number), name + " = " + value + " #" + type);
|
||||||
|
stream->flush();
|
||||||
|
if (isFile) file->flush();
|
||||||
|
writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SettingsReader::numValues() {
|
||||||
|
return settval.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString SettingsReader::getValue(int number) {
|
||||||
|
return settval.at(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString SettingsReader::getName(int number) {
|
||||||
|
return settname.at(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString SettingsReader::getComment(int number) {
|
||||||
|
return settcom.at(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char SettingsReader::getType(int number) {
|
||||||
|
return setttype.at(number)[0].cell();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SettingsReader::getNumber(const QString & name) {
|
||||||
|
for (int i = 0; i < settname.size(); i++) {
|
||||||
|
if (settname.at(i) == name) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::setValue(int number, const QString & value, bool write) {
|
||||||
|
QString tmp = settname.at(number) + " = " + value + " #" + setttype.at(number) + " " + settcom.at(number);
|
||||||
|
settval.replace(number, value);
|
||||||
|
all.replace(settlines[number], tmp);
|
||||||
|
if (write) writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::setValue(const QString & name, const QString & value, bool write) {
|
||||||
|
int number = getNumber(name);
|
||||||
|
if (number == -1) return;
|
||||||
|
QString tmp = settname.at(number) + " = " + value + " #" + setttype.at(number) + " " + settcom.at(number);
|
||||||
|
settval.replace(number, value);
|
||||||
|
all.replace(settlines[number], tmp);
|
||||||
|
if (write) writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::setName(int number, const QString & name) {
|
||||||
|
QString tmp = name + " = " + settval.at(number) + " #" + setttype.at(number) + " " + settcom.at(number);
|
||||||
|
settname.replace(number, name);
|
||||||
|
all.replace(settlines[number], tmp);
|
||||||
|
writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::setType(int number, const QString & type) {
|
||||||
|
QString tmp = settname.at(number) + " = " + settval.at(number) + " #" + type + " " + settcom.at(number);
|
||||||
|
setttype.replace(number, type);
|
||||||
|
all.replace(settlines[number], tmp);
|
||||||
|
writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::setComment(int number, const QString & comment) {
|
||||||
|
QString tmp = settname.at(number) + " = " + settval.at(number) + " #" + setttype.at(number) + " " + comment;
|
||||||
|
settcom.replace(number, comment);
|
||||||
|
all.replace(settlines[number], tmp);
|
||||||
|
writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::deleteLine(const QString & name) {
|
||||||
|
bool exist = false;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < settname.size(); i++) {
|
||||||
|
if (settname.at(i) == name) {
|
||||||
|
exist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!exist) return;
|
||||||
|
deleteLine(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::deleteLine(int number) {
|
||||||
|
settname.remove(number);
|
||||||
|
settval.remove(number);
|
||||||
|
settcom.remove(number);
|
||||||
|
setttab.remove(number);
|
||||||
|
setttype.remove(number);
|
||||||
|
all.remove(settlines[number]);
|
||||||
|
for (int i = number; i < settlines.size(); i++) settlines[i]--;
|
||||||
|
settlines.remove(number);
|
||||||
|
writeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::writeAll() {
|
||||||
|
if (isFile) file->resize(0);
|
||||||
|
else *str = "";
|
||||||
|
stream->seek(0);
|
||||||
|
int c = 0;
|
||||||
|
for (int i = 0; i < all.size(); i++) {
|
||||||
|
if (c < settlines.size() && c < setttab.size()) {
|
||||||
|
if (settlines[c] == i) {
|
||||||
|
*stream << setttab.at(c);
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*stream << all.at(i) << endl;
|
||||||
|
}
|
||||||
|
if (isFile) file->flush();
|
||||||
|
readAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::readAll() {
|
||||||
|
settname.clear();
|
||||||
|
settval.clear();
|
||||||
|
settcom.clear();
|
||||||
|
setttab.clear();
|
||||||
|
settlines.clear();
|
||||||
|
setttype.clear();
|
||||||
|
all.clear();
|
||||||
|
if (isFile) file->flush();
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsReader::parse() {
|
||||||
|
QString str, tab, comm;
|
||||||
|
int ind, sind;
|
||||||
|
stream->seek(0);
|
||||||
|
lines = 0;
|
||||||
|
if (isFile) if (!file->exists()) return;
|
||||||
|
while (!stream->atEnd()) {
|
||||||
|
str = stream->readLine();
|
||||||
|
tab = str.left(str.indexOf(str.trimmed().left(1)));
|
||||||
|
str = str.trimmed();
|
||||||
|
all.append(str);
|
||||||
|
ind = str.indexOf('=');
|
||||||
|
if ((ind > 0) && !(str.left(1) == "#")) {
|
||||||
|
sind = str.indexOf('#');
|
||||||
|
if (sind > 0) {
|
||||||
|
comm = str.right(str.length() - sind - 1).trimmed();
|
||||||
|
setttype.append(comm.left(1));
|
||||||
|
comm = comm.right(comm.length() - 1).trimmed();
|
||||||
|
settcom.append(comm);
|
||||||
|
str.truncate(sind);
|
||||||
|
} else {
|
||||||
|
setttype.append("s");
|
||||||
|
settcom.append("");
|
||||||
|
}
|
||||||
|
settname.append((str.left(ind)).trimmed());
|
||||||
|
settval.append((str.right(str.length() - ind - 1)).trimmed());
|
||||||
|
setttab.append(tab);
|
||||||
|
settlines.push_back(lines);
|
||||||
|
}
|
||||||
|
lines++;
|
||||||
|
}
|
||||||
|
}
|
||||||
54
settreader.h
Normal file
54
settreader.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#ifndef __SETT_READER_H__
|
||||||
|
#define __SETT_READER_H__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
|
class SettingsReader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SettingsReader(const QString & fname);
|
||||||
|
SettingsReader(QString * string);
|
||||||
|
~SettingsReader();
|
||||||
|
|
||||||
|
QString getValue(QString vname, QString def = "", bool * exist = 0);
|
||||||
|
QString getValue(int number);
|
||||||
|
QString getName(int number);
|
||||||
|
QString getComment(int number);
|
||||||
|
char getType(int number);
|
||||||
|
int getNumber(const QString & name);
|
||||||
|
void setValue(int number, const QString & value, bool write = true);
|
||||||
|
void setValue(const QString & name, const QString & value, bool write = true);
|
||||||
|
void setName(int number, const QString & name);
|
||||||
|
void setType(int number, const QString & type);
|
||||||
|
void setComment(int number, const QString & comment);
|
||||||
|
int numValues();
|
||||||
|
void addLine(const QString & name, const QString & value, const QString & type = "s");
|
||||||
|
void insertLine(int number, const QString & name, const QString & value, const QString & type = "s");
|
||||||
|
void deleteLine(const QString & name);
|
||||||
|
void deleteLine(int number);
|
||||||
|
void readAll();
|
||||||
|
void writeAll();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void parse();
|
||||||
|
|
||||||
|
bool isFile;
|
||||||
|
int lines;
|
||||||
|
QFile * file;
|
||||||
|
QString * str;
|
||||||
|
QTextStream * stream;
|
||||||
|
QVector<QString> settname;
|
||||||
|
QVector<QString> settval;
|
||||||
|
QVector<QString> settcom;
|
||||||
|
QVector<QString> setttab;
|
||||||
|
QVector<QString> setttype;
|
||||||
|
QVector<QString> all;
|
||||||
|
QVector<int> settlines;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
41
towers.cpp
41
towers.cpp
@@ -4,8 +4,49 @@ Towers::Towers(Game_Data *gd, QObject *parent) :
|
|||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
gameData = gd;
|
gameData = gd;
|
||||||
|
nextId = 0;
|
||||||
|
Tower tw;
|
||||||
|
for (int i=0; i<gameData->players.size(); i++)
|
||||||
|
gameData->players[i]->srcTowers.push_back(tw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Towers::AddTower(int playerId, int srcId, QPoint pos)
|
||||||
|
{
|
||||||
|
if (playerId < 0 || playerId >= gameData->players.size()) qDebug("ERROR out of players range"),exit(-1);
|
||||||
|
if (srcId < 0 || srcId >= gameData->players.at(playerId)->srcTowers.size()) qDebug("ERROR out of towers range"),exit(-1);
|
||||||
|
Tower tw = gameData->players.at(playerId)->srcTowers.at(srcId);
|
||||||
|
tw.Id = nextId;
|
||||||
|
if (gameData->map->addTowerOnMap(playerId,pos))
|
||||||
|
{
|
||||||
|
tw.pos = pos;
|
||||||
|
gameData->map->printMap();
|
||||||
|
nextId++;
|
||||||
|
gameData->curTowers.push_back(tw);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Towers::DelTower(int index)
|
||||||
|
{
|
||||||
|
gameData->curTowers.remove(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Towers::DelTowerById(int Id)
|
||||||
|
{
|
||||||
|
DelTower(TowerIndex(Id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Towers::TowerIndex(int towerId)
|
||||||
|
{
|
||||||
|
int i=-1;
|
||||||
|
for (i=0; i<gameData->curTowers.size(); i++)
|
||||||
|
if (gameData->curTowers.at(i).Id==towerId) return i;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
void Towers::update()
|
void Towers::update()
|
||||||
{
|
{
|
||||||
|
|||||||
6
towers.h
6
towers.h
@@ -10,9 +10,11 @@ class Towers : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Towers(Game_Data * gd, QObject *parent = 0);
|
explicit Towers(Game_Data * gd, QObject *parent = 0);
|
||||||
void AddTower(int srcId);
|
bool AddTower(int playerId, int srcId, QPoint pos);
|
||||||
void DelTowerById(int Id);
|
void DelTowerById(int Id);
|
||||||
|
void DelTowerByPos(QPoint pos);
|
||||||
void DelTower(int index);
|
void DelTower(int index);
|
||||||
|
int TowerIndex(int towerId);
|
||||||
void update();
|
void update();
|
||||||
int size() const {return gameData->curTowers.size();}
|
int size() const {return gameData->curTowers.size();}
|
||||||
signals:
|
signals:
|
||||||
@@ -21,6 +23,8 @@ public slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Game_Data * gameData;
|
Game_Data * gameData;
|
||||||
|
|
||||||
|
int nextId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TOWERS_H
|
#endif // TOWERS_H
|
||||||
|
|||||||
Reference in New Issue
Block a user