Code Monkey home page Code Monkey logo

obiektowebackend's Introduction

ObiektoweBackEnd

Back end project for programowanie obiektowe

obiektowebackend's People

Contributors

pwalig avatar jszyba avatar

Watchers

 avatar

obiektowebackend's Issues

expose training goals as function parameters

In class UTTTLearning methods expose as procedure parameters training goal parameters, that are passed to newGame.SetScoreParameters(...). You can pack them into a struct to improve redability.

Move and SetBeing error codes

int Board::Move(const int & x1, const int & y1, const int & x2, const int & y2)
{
if(x1 < 0 || x1 >= this->fields.size())
return 1;
if(y1 < 0 || y1 >= this->fields[x1].size())
return 2;
if(x2 < 0 || x2 >= this->fields.size())
return 3;
if(y2 < 0 || y2 >= this->fields[x2].size())
return 4;
if(this->fields[x1][y1] == nullptr)
return 5;
if(this->fields[x2][y2] != nullptr)
return 6;
this->fields[x2][y2] = this->fields[x1][y1];
this->fields[x1][y1] = nullptr;
return 0;
}
int Board::SetBeing(Being* b, const int & x, const int & y)
{
if(x < 0 || x >= this->fields.size())
return 1;
if(y < 0 || y >= this->fields[x].size())
return 2;
if(b == nullptr)
return 3;
if(this->fields[x][y] != nullptr)
return 4;
this->fields[x][y] = b;
return 0;
}

Remove 3 and 4 errors from SetBeing
Vertical and horizontal out of bounds checks in both methods should have one - uniform error code.
You can add Remove and Add Being while you're at it: #8

Play Game method

Add void MainGame::Play(); method.

It should:

  1. call MainGame::Update() in a loop until only one player is left (has any beings),

  2. save Board state to a new file after each MainGame::Update() call.

Saving Board state

void MainGame::SaveBoardState(const string & filename){
}

Implement: void MainGame::SaveBoardState(const string & filename).
It should produce file identical to a file that must have been read to get this board state.

Beings to be implemented

Beings:
Mage : HPBeing - adds mana
Structure : HPBeing
Spawner : Structure
Architect : HPBeing
Medic : HPBeing
Vehicle : HPBeing - it would contain other beings temporarily and move with them inside
Ranger : HPBeing - adds ammo
Soldier / Fighter : HPBeing - has an object of a Weapon class

Armours:
ThresholdArmour : Armour

Not every one needs to be added.

Comment your ideas.

Add Being and Remove Being

Add these:
int Board::AddBeing(Being* b, const int & x, const int & y), that would give error when trying to override a being.
int Board::RemoveBeing(const int & x, const int & y), that would give error when trying to remove from empty field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.