Ejemplo n.º 1
0
 public FieldRegion(FieldController dc)
     : base(String.Format("FieldRegion{0}", Count.ToString()), dc.ThisRegionMap, 100, dc.ThisRegionPoint)
 {
     Controller = dc;
     this.Register();
     Count += 1;
 }
Ejemplo n.º 2
0
        public virtual void On_ShutDown(ShutdownEventArgs args)
        {
            for (int i = 0; i < Field_Config.Controllers.Count; ++i)
            {
                FieldController d = (FieldController)Field_Config.Controllers[i];

                if (d.HasStarted && d.Handeling != null)
                {
                    d.EndField(0);
                }
            }
        }
Ejemplo n.º 3
0
        public static void InitializeRegions()
        {
            for (int i = 0; i < Controllers.Count; ++i)
            {
                FieldController controller = (FieldController)Controllers[i];

                if (controller.ThisRegion != null)
                {
                    controller.ThisRegion.Unregister();
                }

                controller.ThisRegion = new FieldRegion(controller);
            }
            Console.WriteLine("Field regions have been initialized.");
        }
Ejemplo n.º 4
0
        public FieldController PickRandomArena()
        {
            FieldController c     = Field_Config.Controllers[Utility.Random(Field_Config.Controllers.Count)];
            int             count = 0;

            while (c.InUse || !c.Enabled && count != 100)
            {
                c = Field_Config.Controllers[Utility.Random(Field_Config.Controllers.Count)];
                count++;
            }

            if (count == 100)
            {
                return(null);
            }
            else
            {
                return(c);
            }
        }