コード例 #1
0
 public void AddChild(VisibleGameObject _object)
 {
     _child.Add(_object);
     _object.X    = _x + _object.OffSetX;
     _object.Y    = _y + _object.OffSetY;
     _object.Rect = new Rectangle((int)_object.X, (int)_object.Y, (int)_object.Width, (int)_object.Height);
     _nChild++;
 }
コード例 #2
0
 public CharacterManager(string xmlInfo)
 {
     _xmlInfo = xmlInfo;
     try
     {
         XmlDocument doc = new XmlDocument();
         doc.Load(_xmlInfo);
         _nprototype = doc.SelectNodes(@"//Character").Count;
         _prototype  = new VisibleGameObject[_nprototype];
     }
     catch
     {
     }
 }
コード例 #3
0
 public ProcessBarManager(string xmlInfo)
 {
     _xmlInfo = xmlInfo;
     try
     {
         XmlDocument _doc = new XmlDocument();
         _doc.Load(_xmlInfo);
         _nprototype = _doc.SelectNodes(@"//ProcessBar").Count;
         _prototype  = new VisibleGameObject[_nprototype];
     }
     catch
     {
     }
 }
コード例 #4
0
 public BackgroundManager(string xmlInfo)
 {
     _xmlInfo = xmlInfo;
     try
     {
         XmlDocument _doc = new XmlDocument();
         _doc.Load(_xmlInfo);
         XmlNodeList _listBackground = _doc.SelectNodes(@"//Background");
         _nprototype = _listBackground.Count;
         _prototype  = new VisibleGameObject[_nprototype];
     }
     catch
     {
     }
 }
コード例 #5
0
 public GameFrameManager(string xmlInfo)
 {
     _xmlInfo = xmlInfo;
     try
     {
         XmlDocument _doc = new XmlDocument();
         _doc.Load(_xmlInfo);
         XmlNodeList _listFrame = _doc.DocumentElement.SelectNodes("//Frame");
         _nprototype = _listFrame.Count;
         _prototype  = new VisibleGameObject [_nprototype];
     }
     catch
     {
     }
 }
コード例 #6
0
        public MapManager(string xmlInfo)
        {
            _xmlInfo = xmlInfo;
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(_xmlInfo);
                _nprototype = doc.SelectNodes(@"//Map").Count;
                _prototype = new VisibleGameObject[_nprototype];
            }
            catch
            {

            }
        }
コード例 #7
0
        public GameTitleManager(string xmlInfo)
        {
            _xmlInfo = xmlInfo;
            try
            {
                XmlDocument _doc = new XmlDocument ();
                _doc.Load (_xmlInfo);
                _nprototype = _doc.SelectNodes(@"//GameTitle").Count;
                _prototype = new VisibleGameObject[_nprototype];
            }
            catch
            {

            }
        }
コード例 #8
0
        public MenuFrameManager(string xmlInfo)
        {
            _xmlInfo = xmlInfo;
            try
            {
                XmlDocument _doc = new XmlDocument();
                _doc.Load(_xmlInfo);
                XmlNodeList _menuFrame = _doc.SelectNodes(@"//MenuFrame");
                _nprototype = _menuFrame.Count;
                _prototype = new VisibleGameObject[_nprototype];
            }
            catch
            {

            }
        }
コード例 #9
0
        public MapObstacleManager(string xmlInfo)
        {
            try
            {
                _xmlInfo = xmlInfo;
                XmlDocument _doc = new XmlDocument();

                _doc.Load(_xmlInfo);
                XmlNodeList _listMapObstacle = _doc.SelectNodes(@"//MapObstacle");
                _nprototype = _listMapObstacle.Count;
                _prototype  = new VisibleGameObject[_nprototype];
            }
            catch
            {
            }
        }
コード例 #10
0
        public BackgroundManager(string xmlInfo)
        {
            _xmlInfo = xmlInfo;
            try
            {
                XmlDocument _doc = new XmlDocument();
                _doc.Load(_xmlInfo);
                XmlNodeList _listBackground = _doc.SelectNodes(@"//Background");
                _nprototype = _listBackground.Count;
                _prototype = new VisibleGameObject[_nprototype];
            }
            catch
            {

            }
        }
コード例 #11
0
        public PortralManager(string xmlInfo)
        {
            try
            {
                _xmlInfo = xmlInfo;
                XmlDocument _doc = new XmlDocument();

                _doc.Load(_xmlInfo);
                XmlNodeList _listPortral = _doc.SelectNodes(@"//Portral");
                _nprototype = _listPortral.Count;
                _prototype  = new VisibleGameObject[_nprototype];
            }
            catch
            {
            }
        }
コード例 #12
0
        public ButtonManger(string xmlInfo)
        {
            try
            {
                _xmlInfo = xmlInfo;
                XmlDocument _doc = new XmlDocument();

                _doc.Load(_xmlInfo);
                XmlNodeList _listButton = _doc.SelectNodes(@"//Button");
                _nprototype = _listButton.Count;
                _prototype  = new VisibleGameObject[_nprototype];
            }
            catch
            {
            }
        }
コード例 #13
0
        public SkillManager(string xmlInfo)
        {
            try
            {
                _xmlInfo = xmlInfo;
                XmlDocument _doc = new XmlDocument();

                _doc.Load(_xmlInfo);
                XmlNodeList _listSkill = _doc.SelectNodes(@"//Skill");
                _nprototype = _listSkill.Count;
                _prototype = new VisibleGameObject[_nprototype];
            }
            catch
            {

            }
        }
コード例 #14
0
        public MapObstacleManager(string xmlInfo)
        {
            try
            {
                _xmlInfo = xmlInfo;
                XmlDocument _doc = new XmlDocument();

                _doc.Load(_xmlInfo);
                XmlNodeList _listMapObstacle = _doc.SelectNodes(@"//MapObstacle");
                _nprototype = _listMapObstacle.Count;
                _prototype = new VisibleGameObject[_nprototype];
            }
            catch
            {

            }
        }
コード例 #15
0
 public virtual void ChildNotify(VisibleGameObject child)
 {
 }
コード例 #16
0
 public override void ChildNotify(VisibleGameObject child)
 {
     //_menuIndex = _child.IndexOf((Button)child);
 }
コード例 #17
0
        public override bool InitPrototypes(ContentManager content, string fileName)
        {
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(fileName);
                XmlNodeList nodelist = doc.SelectNodes(@"//Character");
                _nprototype = nodelist.Count;
                _prototype  = new VisibleGameObject[_nprototype];
                for (int i = 0; i < nodelist.Count; ++i)
                {
                    _prototype[i]          = new PlayerCharacter();
                    _prototype[i]._nsprite = 40;
                    _prototype[i]._sprite  = new GameSprite[_prototype[i]._nsprite];

                    XmlNode      node = nodelist[i].SelectSingleNode(@"Stand");
                    GameSprite[] temp = Utility.LoadSprites(node, content);
                    for (int j = 0; j < 8; ++j)
                    {
                        _prototype[i]._sprite[j] = temp[j];
                    }

                    node = nodelist[i].SelectSingleNode(@"Move");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 8; j < 16; ++j)
                    {
                        _prototype[i]._sprite[j] = temp[j - 8];
                    }

                    node = nodelist[i].SelectSingleNode(@"Attack");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 16; j < 24; ++j)
                    {
                        _prototype[i]._sprite[j] = temp[j - 16];
                    }

                    node = nodelist[i].SelectSingleNode(@"Dying");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 24; j < 32; ++j)
                    {
                        _prototype[i]._sprite[j] = temp[j - 24];
                    }

                    node = nodelist[i].SelectSingleNode(@"Dyed");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 32; j < 40; ++j)
                    {
                        _prototype[i]._sprite[j] = temp[j - 32];
                    }

                    ((PlayerCharacter)_prototype[i]).CellToMove   = new List <Point>();
                    ((PlayerCharacter)_prototype[i]).DestPoint    = new Point();
                    ((PlayerCharacter)_prototype[i]).IsMoving     = false;
                    ((PlayerCharacter)_prototype[i]).Map          = null;
                    ((PlayerCharacter)_prototype[i]).Speed        = int.Parse(nodelist[i].SelectSingleNode(@"Speed").InnerText);
                    ((PlayerCharacter)_prototype[i]).Hp           = int.Parse(nodelist[i].SelectSingleNode(@"Hp").InnerText);
                    ((PlayerCharacter)_prototype[i]).Mp           = int.Parse(nodelist[i].SelectSingleNode(@"Mp").InnerText);
                    ((PlayerCharacter)_prototype[i]).CriticalRate = int.Parse(nodelist[i].SelectSingleNode(@"CriticalRate").InnerText);
                    ((PlayerCharacter)_prototype[i]).Attack       = int.Parse(nodelist[i].SelectSingleNode(@"Damage").InnerText);
                    ((PlayerCharacter)_prototype[i]).Defense      = int.Parse(nodelist[i].SelectSingleNode(@"Defense").InnerText);
                    ((PlayerCharacter)_prototype[i]).AttackSpeed  = int.Parse(nodelist[i].SelectSingleNode(@"AttackSpeed").InnerText);
                    ((PlayerCharacter)_prototype[i]).Range        = int.Parse(nodelist[i].SelectSingleNode(@"Range").InnerText);
                    ((PlayerCharacter)_prototype[i]).X            = 0;
                    ((PlayerCharacter)_prototype[i]).Y            = 0;
                    ((PlayerCharacter)_prototype[i]).HitFrame     = int.Parse(nodelist[i].SelectSingleNode(@"HitFrame").InnerText);
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
コード例 #18
0
 public virtual void ChildNotify(VisibleGameObject child)
 {
 }
コード例 #19
0
 public void RegisterObserver(VisibleGameObject observer)
 {
     _observers.Add(observer);
 }
コード例 #20
0
 public void UnregisterObserver(VisibleGameObject observer)
 {
     _observers.Remove(observer);
 }
コード例 #21
0
        public override bool InitPrototypes(ContentManager content, string fileName)
        {
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(fileName);
                XmlNodeList nodelist = doc.SelectNodes(@"//Character");
                _nprototype = nodelist.Count;
                _prototype = new VisibleGameObject[_nprototype];
                for (int i = 0; i < nodelist.Count; ++i)
                {
                    _prototype[i] = new PlayerCharacter();
                    _prototype[i]._nsprite = 40;
                    _prototype[i]._sprite = new GameSprite[_prototype[i]._nsprite];

                    XmlNode node = nodelist[i].SelectSingleNode(@"Stand");
                    GameSprite[] temp = Utility.LoadSprites(node, content);
                    for (int j = 0; j < 8; ++j)
                        _prototype[i]._sprite[j] = temp[j];

                    node = nodelist[i].SelectSingleNode(@"Move");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 8; j < 16; ++j)
                        _prototype[i]._sprite[j] = temp[j - 8];

                    node = nodelist[i].SelectSingleNode(@"Attack");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 16; j < 24; ++j)
                        _prototype[i]._sprite[j] = temp[j - 16];

                    node = nodelist[i].SelectSingleNode(@"Dying");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 24; j < 32; ++j)
                        _prototype[i]._sprite[j] = temp[j - 24];

                    node = nodelist[i].SelectSingleNode(@"Dyed");
                    temp = Utility.LoadSprites(node, content);
                    for (int j = 32; j < 40; ++j)
                        _prototype[i]._sprite[j] = temp[j - 32];

                    ((PlayerCharacter)_prototype[i]).CellToMove = new List<Point>();
                    ((PlayerCharacter)_prototype[i]).DestPoint = new Point();
                    ((PlayerCharacter)_prototype[i]).IsMoving = false;
                    ((PlayerCharacter)_prototype[i]).Map = null;
                    ((PlayerCharacter)_prototype[i]).Speed = int.Parse(nodelist[i].SelectSingleNode(@"Speed").InnerText);
                    ((PlayerCharacter)_prototype[i]).Hp = int.Parse(nodelist[i].SelectSingleNode(@"Hp").InnerText);
                    ((PlayerCharacter)_prototype[i]).Mp = int.Parse(nodelist[i].SelectSingleNode(@"Mp").InnerText);
                    ((PlayerCharacter)_prototype[i]).CriticalRate = int.Parse(nodelist[i].SelectSingleNode(@"CriticalRate").InnerText);
                    ((PlayerCharacter)_prototype[i]).Attack = int.Parse(nodelist[i].SelectSingleNode(@"Damage").InnerText);
                    ((PlayerCharacter)_prototype[i]).Defense = int.Parse(nodelist[i].SelectSingleNode(@"Defense").InnerText);
                    ((PlayerCharacter)_prototype[i]).AttackSpeed = int.Parse(nodelist[i].SelectSingleNode(@"AttackSpeed").InnerText);
                    ((PlayerCharacter)_prototype[i]).Range = int.Parse(nodelist[i].SelectSingleNode(@"Range").InnerText);
                    ((PlayerCharacter)_prototype[i]).X = 0;
                    ((PlayerCharacter)_prototype[i]).Y = 0;
                    ((PlayerCharacter)_prototype[i]).HitFrame = int.Parse(nodelist[i].SelectSingleNode(@"HitFrame").InnerText);
                }
                return true;
            }
            catch
            {
                return false;
            }
        }
コード例 #22
0
 public override void ChildNotify(VisibleGameObject child)
 {
     //_menuIndex = _child.IndexOf((Button)child);
 }
コード例 #23
0
 public void UnregisterObserver(VisibleGameObject observer)
 {
     _observers.Remove(observer);
 }
コード例 #24
0
 public void RegisterObserver(VisibleGameObject observer)
 {
     _observers.Add(observer);
 }