remove unit inheritence, twas a silly idea, and remove usage of shared ptr and unique ptr not needed anymore

This commit is contained in:
Marc Di Luzio 2014-12-16 13:13:01 +00:00
parent 0700a13129
commit 0c7721cb17
8 changed files with 101 additions and 142 deletions

View file

@ -1,6 +1,5 @@
#include <iostream> // std::cout
#include "unitv.h"
#include "board.h"
#include "orders.h"
#include "game.h"
@ -14,21 +13,22 @@ const char* tests()
}
{
CUnitV myV;
if( myV.getVisual() != 'v' && myV.getVisual() != '<' && myV.getVisual() != '^' && myV.getVisual() != '>' )
CUnit unit;
unit.setFromVisual('v');
if( unit.getVisual() != 118 )
return "failed to properly create V unit";
}
{
CUnitV myV;
CUnitV myV2;
if( myV.getID() == myV2.getID() )
CUnit unit;
CUnit unit2;
if( unit.getID() == unit2.getID() )
return "Unit IDs the same";
}
{
std::unique_ptr<CUnit> myV = CUnit::getUnitFromVis('v');
if( myV->getVisual() != 'v' )
CUnit unit = CUnit::getUnitFromVis('v');
if( unit.getVisual() != 'v' )
return "failed to properly create V unit";
}