Example #1
0
int parseGame(const char *filename) {

   initParser();

   if (!parseGameFile(filename)) {
      g_outputError("failed to parse game file %s\n", filename);
      return 0;
   }

   /* make sure a room named "start" exists */
   if (NULL == g_hash_table_lookup(roomParsedTable, "start")) {
      g_outputError("room 'start' must be defined\n");
      return 0;
   }

   initGlobalEvents();
   initObjects();
   initCreatures();
   initRooms();

   /* make sure we didn't have any issues parsing Lua scripts */
   if (g_scriptError) {
      return 0;
   }

   destroyParser();
   return 1;
}
Example #2
0
ComputerManager::ComputerManager( UserConfig& config,
								  FeatureManager& featureManager,
								  BuiltinFeatures& builtinFeatures,
								  QObject* parent ) :
	QObject( parent ),
	m_config( config ),
	m_featureManager( featureManager ),
	m_builtinFeatures( builtinFeatures ),
	m_networkObjectDirectoryManager( new NetworkObjectDirectoryManager() ),
	m_networkObjectDirectory( m_networkObjectDirectoryManager->createDirectory( this ) ),
	m_networkObjectModel( new NetworkObjectTreeModel( m_networkObjectDirectory ) ),
	m_networkObjectOverlayDataModel( new NetworkObjectOverlayDataModel( 1, Qt::DisplayRole, tr( "User" ), this ) ),
	m_computerTreeModel( new CheckableItemProxyModel( NetworkObjectModel::UidRole, this ) ),
	m_networkObjectFilterProxyModel( new NetworkObjectFilterProxyModel( this ) )
{
	if( m_networkObjectDirectory == nullptr )
	{
		QMessageBox::critical( nullptr,
							   tr( "Missing network object directory plugin" ),
							   tr( "No default network object directory plugin was found. "
								   "Please check your installation or configure a different "
								   "network object directory backend via %1 Configurator." ).
							   arg( VeyonCore::applicationName() ) );
		qFatal( "ComputerManager: missing network object directory plugin!" );
	}

	initNetworkObjectLayer();
	initRooms();
	initComputerTreeModel();
	updateComputerList();

	auto computerScreenUpdateTimer = new QTimer( this );
	connect( computerScreenUpdateTimer, &QTimer::timeout, this, &ComputerManager::updateComputerScreens );
	computerScreenUpdateTimer->start( 1000 );		// TODO: replace constant
}
Example #3
0
RoomManager::RoomManager()
{
	srand(time(NULL));
	addPlayerMutex = PTHREAD_MUTEX_INITIALIZER;
	MAX_ONE_TYPE_ROOMS = 10;
	initRooms();
	initMap();
}
Example #4
0
void initLists(Bool printList)
{
    initAbsences();
    initAppointments();

    initConsultations();
    initDoctors();
    initPatients();
    initRooms();
    if(printList)
        printLists();
}
Example #5
0
void Game::initAssets()
{
    _assets.bots.spriteSheet = _display->createSpriteSheet(Rectangle(32,32),10,10);
    _assets.bots.red.up = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/red/up.png");
    _assets.bots.red.right = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/red/right.png");
    _assets.bots.red.down = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/red/down.png");
    _assets.bots.red.left = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/red/left.png");
    _assets.bots.blue.up = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/blue/up.png");
    _assets.bots.blue.right = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/blue/right.png");
    _assets.bots.blue.down = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/blue/down.png");
    _assets.bots.blue.left = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/blue/left.png");
    _assets.bots.green.up = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/green/up.png");
    _assets.bots.green.right = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/green/right.png");
    _assets.bots.green.down = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/green/down.png");
    _assets.bots.green.left = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/green/left.png");
    _assets.bots.player.up = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/player/up.png");
    _assets.bots.player.right = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/player/right.png");
    _assets.bots.player.down = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/player/down.png");
    _assets.bots.player.left = _display->createTexture(_assets.bots.spriteSheet,"assets/img/bots/player/left.png");
    
    _assets.inventory.spriteSheet = _display->createSpriteSheet(Rectangle(48,48),5,5);
    _assets.inventory.inventoryBG = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/inventorybg.png");
    _assets.inventory.smallAmmo = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/smallammo.png");
    _assets.inventory.heavyAmmo = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.bombAmmo = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.scrapmetal = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/scrapmetal.png");
    _assets.inventory.bombLauncher = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.sniperRifle = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.smallGun = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.wrench = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.redDoorCard = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.blueDoorCard = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.greenDoorCard = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");
    _assets.inventory.augmentation = _display->createTexture(_assets.inventory.spriteSheet,"assets/img/inventory/placeholder.png");

    _assets.selection.spriteSheet = _display->createSpriteSheet(Rectangle(8,8),2,2);
    _assets.selection.NW = _display->createTexture(_assets.selection.spriteSheet,"assets/img/inventory/selection/NW.png");
    _assets.selection.NE = _display->createTexture(_assets.selection.spriteSheet,"assets/img/inventory/selection/NE.png");
    _assets.selection.SW = _display->createTexture(_assets.selection.spriteSheet,"assets/img/inventory/selection/SW.png");
    _assets.selection.SE = _display->createTexture(_assets.selection.spriteSheet,"assets/img/inventory/selection/SE.png");

    _assets.tiles.spriteSheet = _display->createSpriteSheet(Rectangle(32,32),5,5);
    _assets.tiles.overlay.gray = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/grayoverlay.png");
    _assets.tiles.overlay.black = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/blackoverlay.png");
    _assets.tiles.door.red = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/reddoor.png");
    _assets.tiles.door.green = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/greendoor.png");
    _assets.tiles.door.blue = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/bluedoor.png");
    _assets.tiles.floor = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/floor.png");
    _assets.tiles.wall = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/wall.png");
    _assets.tiles.exit_open = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/exit.png");
    _assets.tiles.exit_locked = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/exit_locked.png");
    _assets.tiles.computer = _display->createTexture(_assets.tiles.spriteSheet,"assets/img/tiles/computer.png");
    
    _assets.environment.spriteSheet = _display->createSpriteSheet(Rectangle(32,32),5,5);
    _assets.environment.crate = _display->createTexture(_assets.environment.spriteSheet,"assets/img/environments/crate.png");

    _assets.fonts.mono36 = _display->loadTrueTypeFont("assets/fonts/MostlyMono.ttf",48);
    _assets.fonts.mono28 = _display->loadTrueTypeFont("assets/fonts/MostlyMono.ttf",28);
    _assets.fonts.mono20 = _display->loadTrueTypeFont("assets/fonts/MostlyMono.ttf",24);

    _assets.others.statsBackground = _display->loadImage("assets/img/others/stats.png");
    _assets.others.inventoryBackground = _display->loadImage("assets/img/others/inv.png");
    initRooms();
}