Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f8cdfd410a |
Generated
+10
@@ -0,0 +1,10 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Ignored default folder with query files
|
||||
/queries/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 4.1)
|
||||
project(cv9)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
add_executable(cv9 main.cpp
|
||||
herniEntita.cpp
|
||||
herniEntita.h
|
||||
Hrac.cpp
|
||||
Hrac.h
|
||||
Past.cpp
|
||||
Past.h
|
||||
Npc.cpp
|
||||
Npc.h)
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by Franc on 14.04.2026.
|
||||
//
|
||||
|
||||
#include "Hrac.h"
|
||||
|
||||
Hrac::Hrac(string name, int pos_x, int pos_y, int hpecka) :herniEntita(name, pos_x, pos_y) {
|
||||
this->hp = hpecka;
|
||||
}
|
||||
|
||||
int Hrac::getHP() {
|
||||
return this->hp;
|
||||
}
|
||||
|
||||
void Hrac::provedAkci() {
|
||||
this->hp+=10;
|
||||
cout << "Hrac: "<< this->getName()<<"se vylecil." << "Aktualní hp: "<< this->getHP() << endl;
|
||||
}
|
||||
|
||||
|
||||
string Hrac::getStatus() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by Franc on 14.04.2026.
|
||||
//
|
||||
|
||||
#ifndef CV9_HRAC_H
|
||||
#define CV9_HRAC_H
|
||||
#include "herniEntita.h"
|
||||
|
||||
|
||||
class Hrac :public herniEntita {
|
||||
private:
|
||||
int hp;
|
||||
public:
|
||||
Hrac(string name, int pos_x, int pos_y, int hpecka);
|
||||
virtual void provedAkci() override;
|
||||
|
||||
string getStatus() override;
|
||||
|
||||
int getHP();
|
||||
};
|
||||
|
||||
|
||||
#endif //CV9_HRAC_H
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Created by Franc on 14.04.2026.
|
||||
//
|
||||
|
||||
#ifndef CV9_NPC_H
|
||||
#define CV9_NPC_H
|
||||
#include "herniEntita.h"
|
||||
|
||||
|
||||
class Npc :public herniEntita {
|
||||
private:
|
||||
string dialog;
|
||||
public:
|
||||
void provedAkci() override;
|
||||
string getStatus() override;
|
||||
};
|
||||
|
||||
|
||||
#endif //CV9_NPC_H
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by Franc on 14.04.2026.
|
||||
//
|
||||
|
||||
#ifndef CV9_PAST_H
|
||||
#define CV9_PAST_H
|
||||
#include "herniEntita.h"
|
||||
|
||||
|
||||
class Past : public herniEntita{
|
||||
private:
|
||||
int dmg;
|
||||
bool nabita;
|
||||
public:
|
||||
void provedAkci() override;
|
||||
string getStatus() override;
|
||||
};
|
||||
|
||||
|
||||
#endif //CV9_PAST_H
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Created by Franc on 14.04.2026.
|
||||
//
|
||||
|
||||
#include "herniEntita.h"
|
||||
|
||||
|
||||
herniEntita::herniEntita(string name, int pos_x, int pos_y) {
|
||||
this->nazev = name;
|
||||
this-> x = pos_x;
|
||||
this->y = pos_y;
|
||||
}
|
||||
|
||||
herniEntita::~herniEntita() {
|
||||
}
|
||||
|
||||
int herniEntita::getPos() {
|
||||
return this->x,this->y;
|
||||
}
|
||||
|
||||
string herniEntita::getName() {
|
||||
return this->nazev;
|
||||
}
|
||||
|
||||
void herniEntita::provedAkci() {
|
||||
cout << "Instance bazove tridy: " << this->getName() <<" ktera nic nedela..."<<endl;
|
||||
}
|
||||
|
||||
string herniEntita::getStatus() {
|
||||
return "HerniEntita: "+ this->x + this->y;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Created by Franc on 14.04.2026.
|
||||
//
|
||||
|
||||
#ifndef CV9_HERNIENTITA_H
|
||||
#define CV9_HERNIENTITA_H
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class herniEntita {
|
||||
protected:
|
||||
string nazev;
|
||||
int x, y;
|
||||
|
||||
public:
|
||||
herniEntita(string name, int pos_x, int pos_y);
|
||||
|
||||
virtual string getName();
|
||||
|
||||
virtual int getPos();
|
||||
|
||||
virtual ~herniEntita();
|
||||
|
||||
virtual void provedAkci();
|
||||
|
||||
virtual string getStatus();
|
||||
};
|
||||
|
||||
|
||||
#endif //CV9_HERNIENTITA_H
|
||||
Reference in New Issue
Block a user