예제 #1
0
 public BattleCharactersManager(CBattlefield controller, MBaseMap model, VBaseMap view)
 {
     cBattlefield  = controller;
     mBaseMap      = model;
     vBaseMap      = view;
     baseMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
 }
예제 #2
0
파일: CharacterAI.cs 프로젝트: zlbsy/sh109
 public CharacterAI(CBattlefield controller, MBaseMap model, VBaseMap view)
 {
     cBattlefield = controller;
     mBaseMap     = model;
     //vBaseMap = view;
     //baseMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
 }
예제 #3
0
 public AStar(App.Controller.Common.CBaseMap controller, MBaseMap model, VBaseMap view)
 {
     cBaseMap = controller;
     //mBaseMap = model;
     vBaseMap = view;
     //baseMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
 }
예제 #4
0
        public void ToBuild(int buildId)
        {
            MBuilding mBuilding = BuildingCacher.Instance.GetBuilding(buildId);

            App.Model.Master.MBuilding buildingMaster = mBuilding.Master;
            VBaseMap vBaseMap = (App.Util.SceneManager.CurrentScene as CTop).GetVBaseMap();

            App.Model.MTile[] tiles = vBaseMap.ViewModel.Tiles.Value;
            int currentNum          = System.Array.FindAll(tiles, _ => _.tile_id == buildingMaster.tile_id).Length;

            if (currentNum < buildingMaster.sum)
            {
                if (BuyManager.CanBuy(buildingMaster.price, buildingMaster.price_type))
                {
                    this.StartCoroutine(Build(mBuilding.TileId, vBaseMap, buildingMaster));
                }
                else
                {
                    //Confirm dialog
                }
            }
            else
            {
                //Confirm dialog
                CAlertDialog.Show("已经达到了购买的上限了!");
            }
        }
예제 #5
0
파일: TileMap.cs 프로젝트: zlbsy/sh109
 public TileMap(MBaseMap model, VBaseMap view)
 {
     mBaseMap = model;
     vBaseMap = view;
     if (mBaseMap.MapId > 0)
     {
         baseMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
     }
 }
예제 #6
0
 public BreadthFirst(App.Controller.Common.CBaseMap controller, MBaseMap model, VBaseMap view)
 {
     cBaseMap = controller;
     mBaseMap = model;
     vBaseMap = view;
     if (cBaseMap is App.Controller.Battle.CBattlefield)
     {
         cBattlefield = cBaseMap as App.Controller.Battle.CBattlefield;
     }
     baseMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
 }
예제 #7
0
        private IEnumerator Build(int buildId, VBaseMap vBaseMap, App.Model.Master.MBuilding buildingMaster)
        {
            App.Model.Master.MBaseMap topMapMaster = BaseMapCacher.Instance.Get(vBaseMap.ViewModel.MapId.Value);
            Vector2 coordinate = topMapMaster.GetCoordinateFromIndex(tileIndex);
            SShop   sShop      = new SShop();

            yield return(StartCoroutine(sShop.RequestBuyBuild(buildId, (int)coordinate.x, (int)coordinate.y)));

            App.Model.MTile        currentTile = App.Model.MTile.Create(buildingMaster.tile_id, (int)coordinate.x, (int)coordinate.y);
            List <App.Model.MTile> tileList    = vBaseMap.ViewModel.Tiles.Value.ToList();

            tileList.Add(currentTile);
            vBaseMap.ViewModel.Tiles.Value = tileList.ToArray();
            this.Close();
        }
예제 #8
0
 //private MBaseMap mBaseMap;
 //private VBaseMap vBaseMap;
 public BattleCalculateManager(CBattlefield controller, MBaseMap model, VBaseMap view)
 {
     cBattlefield = controller;
     //mBaseMap = model;
     //vBaseMap = view;
 }