lots of initial design for the game, and unit data
This commit is contained in:
parent
6a17e4e4c1
commit
a17a9db2ad
5 changed files with 56 additions and 4 deletions
|
@ -1,18 +1,19 @@
|
|||
#include "unit.h"
|
||||
|
||||
// Unit types
|
||||
#include "unitv.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
std::unique_ptr<CUnit> CUnit::getUnitFromVis( unitVis_c vis )
|
||||
{
|
||||
switch( vis )
|
||||
{
|
||||
// Match with any image for a V
|
||||
case '^':
|
||||
case '>':
|
||||
case 'v':
|
||||
case '<':
|
||||
{
|
||||
// Create a V
|
||||
std::unique_ptr<CUnit> p = std::unique_ptr<CUnit>(new CUnitV);
|
||||
if( (bool)p && p->setFromVisual(vis) )
|
||||
{
|
||||
|
@ -22,5 +23,6 @@ std::unique_ptr<CUnit> CUnit::getUnitFromVis( unitVis_c vis )
|
|||
}
|
||||
}
|
||||
|
||||
// No unit found, return nullptr
|
||||
return std::move(std::unique_ptr<CUnit>(nullptr));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue