Example #1
0
        public BU_Robot(XRobot XRobot, BattleWorld World)
            : base(World)
        {
            _xRob = XRobot;
            _world = World;
            XRobot.RegistedToWorld(this, World.Env,World.Map);

            //机器人默认行进速度1.0
            Speed = 2;

            _hp = 100;
        }
Example #2
0
        private Dictionary<Guid, BattleUnit> _units = new Dictionary<Guid, BattleUnit>(); //所有物件集合

        #endregion Fields

        #region Constructors

        public BattleWorld(XRobot[] Robots,BattleMap Map,BattleCfg Cfg,BattleEnv Env)
        {
            //_robs = new BU_Robot[Robots.Length];
            foreach (XRobot bot in Robots)
            {
                //添加机器人到战场
                AddUnit(new BU_Robot(bot, this));
            }

            _matrix = new TimeMatrix(this);
            this.Config = Cfg;
            this.Map = Map;
            this.Env = Env;
        }