public GameHandler(Manager manager, Network network, GameMain game, ContentManager content, GraphicsDeviceManager graphics, SpriteBatch spriteBatch, GameModelBank modelBank, GameItemBank itemBank, Dictionary <short, GameClassConfig> classConfigs, GameCamera camera, AudioSystem audioSystem, ParticlePreset particleManager)
 {
     this.manager     = manager;
     this.game        = game;
     this.content     = content;
     this.graphics    = graphics;
     this.spriteBatch = spriteBatch;
     // Bank & Config
     this.modelBank    = modelBank;
     this.itemBank     = itemBank;
     this.classConfigs = classConfigs;
     // System handler
     this.camera  = camera;
     this.network = network;
     // Entities
     this.monstersEntity = new Dictionary <String, UnitEntity>();
     this.npcsEntity     = new Dictionary <String, UnitEntity>();
     this.playersEntity  = new Dictionary <String, UnitEntity>();
     this.warpsEntity    = new Dictionary <String, WarpEntity>();
     this.itemsEntity    = new Dictionary <String, ItemEntity>();
     this.playerEntity   = null;
     // Effects
     this.audioSystem     = audioSystem;
     this.particleManager = particleManager;
     // Load font
     entityNameFont   = content.Load <SpriteFont>("Fonts/EntityName");
     entityDamageFont = content.Load <SpriteFont>("Fonts/EntityDamage");
     // White rect
     whiteRect = new Texture2D(graphics.GraphicsDevice, 1, 1);
     whiteRect.SetData(new[] { Color.White });
 }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // Main Background
            mainBackground = Content.Load <Texture2D>("mainbg");
            // Loading Background
            loadingBackground = Content.Load <Texture2D>("loadingbg");
            // TODO: use this.Content to load your game content here
            // Initializing model bank which using for storing model file path
            modelBank = new GameModelBank(Content);
            // Initializing item bank which using for storing item data path
            itemBank = new GameItemBank(Content);
            // Load all model path here.
            Dictionary <short, GameModelConfig> modellist = config.getModelList();

            foreach (short id in modellist.Keys)
            {
                modelBank.Load(id, modellist[id]);
                // Cache
                GameModelNode cache = new GameModelNode(Content, modelBank);
                cache.Load(modelBank.getModelPath(id));
            }
            Dictionary <int, GameItemConfig> itemlist = config.getItemList();

            foreach (short id in itemlist.Keys)
            {
                itemBank.Load(id, itemlist[id]);
            }
            // Load all map
            Dictionary <short, GameMapConfig> maplist = config.getMapList();

            foreach (short id in maplist.Keys)
            {
                mapEntities.Add(id, new MapEntity(id, maplist[id], Content));
            }
            // Server configuration
            serverConfig = config.getServerList()[0];
            // Initializing game camera
            gameCamera = new GameCamera(graphics);
            // Particle system
            particle = new ParticlePreset(this, graphics, gameCamera);
            particle.LoadContent();
            // Game Event handler object
            gameHandler = new GameHandler(manager, network, this, Content, graphics, spriteBatch, modelBank, itemBank, classConfigs, gameCamera, audioSystem, particle);
            // Shadow map
            //shadow.LoadContent(spriteBatch, gameCamera);
            // Bloom post process
            bloom.Settings = BloomSettings.PresetSettings[0];
            // Way to go Effect
            wayToGoEffect = new GameModel(Content);
            wayToGoEffect.Load("waytogo");
            //Debug.WriteLine("LoadedContent");
        }
 public ParticleManager(Game game, GraphicsDeviceManager graphics, GameCamera camera)
 {
     this.game     = game;
     this.graphics = graphics;
     this.camera   = camera;
     particle      = new Particle[1000];
     particleDis   = new Particle[20];
     particleMesh  = new Particle[20];
     modelset      = new Dictionary <int, Model>();
     textureset    = new Dictionary <int, Texture2D>();
     texturenorm   = new Dictionary <int, Texture2D>();
 }
 public ParticlePreset(Game game, GraphicsDeviceManager graphics, GameCamera camera)
     : base(game, graphics, camera)
 {
 }