public bool Process()
        {
            if (!MapLogic.Instance.IsLoaded)
            {
                return(false);
            }

            if (X < 0 || X >= MapLogic.Instance.Width ||
                Y < 0 || Y >= MapLogic.Instance.Height)
            {
                return(false);
            }

            MapNode node = MapLogic.Instance.Nodes[X, Y];

            foreach (MapObject mobj in node.Objects)
            {
                // check object type.
                if (mobj.GetObjectType() != MapObjectType.Obstacle)
                {
                    continue;
                }

                MapObstacle ob = (MapObstacle)mobj;
                ob.SetDead(false);
            }

            return(true);
        }
Beispiel #2
0
        public bool Process()
        {
            if (!MapLogic.Instance.IsLoaded)
            {
                return(false);
            }

            if (X < 0 || X >= MapLogic.Instance.Width ||
                Y < 0 || Y >= MapLogic.Instance.Height)
            {
                return(false);
            }

            MapNode node = MapLogic.Instance.Nodes[X, Y];

            for (int i = 0; i < node.Objects.Count; i++)
            {
                // check object type.
                if (node.Objects[i].GetObjectType() != MapObjectType.Obstacle)
                {
                    continue;
                }

                MapObstacle ob = (MapObstacle)node.Objects[i];
                ob.SetDead(false);
            }

            return(true);
        }