advanced-games-library
Version:
Advanced Gaming Library for React Native - Four Complete Games with iOS Compatibility Fixes
94 lines (82 loc) • 3.25 kB
JavaScript
/**
* Game Components Export File
* This file exports all React Native game components for easy import in other projects
*
* Usage:
* import { SimplePuzzleGameComponent, DemoGameComponent } from 'advanced-games-library/components';
*
* @version 1.0.0
* @author Games Studio
*/
// Import all game components directly - EXPLICIT .js FILES ONLY
const DemoGameComponent = require('./src/games/DemoGame.js');
const MemoryMatchGameComponent = require('./src/games/MemoryMatchGame.js');
const SimplePuzzleGameComponent = require('./src/games/SimplePuzzleGame.js');
const ReactionTimeGameComponent = require('./src/games/ReactionTimeGame.js');
const ImagePuzzleGameComponent = require('./src/games/ImagePuzzleGame.js');
// Import common components directly - EXPLICIT .js FILES ONLY
const GameContainer = require('./src/components/common/GameContainer.js');
const GameHeader = require('./src/components/common/GameHeader.js');
const GameModal = require('./src/components/common/GameModal.js');
const GameWidgets = require('./src/components/common/GameWidgets.js');
// Import services directly - EXPLICIT .js FILES ONLY
const GameManager = require('./src/services/GameManager.js');
const AnalyticsService = require('./src/services/AnalyticsService.js');
const PlayerService = require('./src/services/PlayerService.js');
const StorageService = require('./src/services/StorageService.js');
const CustomizationService = require('./src/services/CustomizationService.js');
// Export all available components
module.exports = {
// Main Game Components
SimplePuzzleGameComponent,
SimplePuzzleScreen: SimplePuzzleGameComponent,
DemoGameComponent,
MemoryMatchGame: MemoryMatchGameComponent,
ReactionTimeGame: ReactionTimeGameComponent,
ImagePuzzleGame: ImagePuzzleGameComponent,
// Common UI Components
GameContainer,
GameHeader,
GameModal,
GameWidgets,
// Game Classes (for programmatic use)
SimplePuzzleGame: SimplePuzzleGameComponent,
GameManager,
// Services
AnalyticsService,
PlayerService,
StorageService,
CustomizationService,
// Version info
version: '4.0.0',
// Helper function to check if a component is available
isComponentAvailable: (componentName) => {
const components = {
SimplePuzzleGameComponent,
DemoGameComponent,
MemoryMatchGame: MemoryMatchGameComponent,
ReactionTimeGame: ReactionTimeGameComponent,
ImagePuzzleGame: ImagePuzzleGameComponent,
GameContainer,
GameHeader,
GameModal,
GameWidgets
};
return components[componentName] !== null && components[componentName] !== undefined;
},
// Get all available components
getAvailableComponents: () => {
return [
'SimplePuzzleGameComponent', 'SimplePuzzleScreen', 'DemoGameComponent',
'MemoryMatchGame', 'ReactionTimeGame', 'ImagePuzzleGame',
'GameContainer', 'GameHeader', 'GameModal', 'GameWidgets'
];
},
// Initialize the library with components
initialize: async (config = {}) => {
console.log('🎮 Components library initialized with config:', config);
return { success: true, version: '4.0.0' };
}
};
// Also export as default for ES6 import compatibility
module.exports.default = module.exports;