using System; using System.Collections.Generic; using System.Linq; using System.Text; using XML_Data_Loader; using Microsoft.Xna.Framework.Content; namespace TopFalling3 { class BulletBuilder { Dictionary bulletList = new Dictionary(); //ContentManager contentManager; public BulletBuilder()//ContentManager contentIn) { //contentManager = contentIn; } public void LoadBullet(ContentManager contentManager, string BulletXMLFilename) { BulletData bd = new BulletData(); bd = contentManager.Load(BulletXMLFilename); Bullet b = new Bullet(); b.LoadBulletData(bd); b.LoadContent(contentManager, bd.textureName); string key = BulletXMLFilename.Substring(BulletXMLFilename.LastIndexOf("/")+1); bulletList.Add(key,b); } public Bullet Peak(string BulletName) { return bulletList[BulletName]; } public Bullet CreateBullet(string BulletName) { if (bulletList.ContainsKey(BulletName)) { Bullet b = (Bullet)bulletList[BulletName].ShallowCopy(); b.Initialize(); return b; } return null; } } }