Example #1
0
        // Token: 0x060036EF RID: 14063 RVA: 0x000F4278 File Offset: 0x000F2478
        public bool InitializeTerrain(ConfigDataBattlefieldInfo battlefieldInfo, IConfigDataLoader configDataLoader)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitializeTerrainConfigDataBattlefieldInfoIConfigDataLoader_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_InitializeTerrainConfigDataBattlefieldInfoIConfigDataLoader_hotfix.call(new object[]
                {
                    this,
                    battlefieldInfo,
                    configDataLoader
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (battlefieldInfo.Terrains.Count != battlefieldInfo.Width * battlefieldInfo.Height)
            {
                return(false);
            }
            if (battlefieldInfo.Width != this.m_width || battlefieldInfo.Height != this.m_height)
            {
                return(false);
            }
            int num = 0;

            for (int i = 0; i < this.m_height; i++)
            {
                for (int j = 0; j < this.m_width; j++)
                {
                    int           key           = battlefieldInfo.Terrains[num++];
                    BattleMapCell battleMapCell = this.m_cells[i, j];
                    battleMapCell.m_terrain = configDataLoader.GetConfigDataTerrainInfo(key);
                    battleMapCell.m_actor   = null;
                    battleMapCell.m_region  = 0;
                }
            }
            return(true);
        }
Example #2
0
        // Token: 0x060036F6 RID: 14070 RVA: 0x000F4798 File Offset: 0x000F2998
        public void SetTerrain(GridPosition p, ConfigDataTerrainInfo terrainInfo)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetTerrainGridPositionConfigDataTerrainInfo_hotfix != null)
            {
                this.m_SetTerrainGridPositionConfigDataTerrainInfo_hotfix.call(new object[]
                {
                    this,
                    p,
                    terrainInfo
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (terrainInfo == null)
            {
                return;
            }
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return;
            }
            cell.m_terrain = terrainInfo;
        }
Example #3
0
 // Token: 0x060036EE RID: 14062 RVA: 0x000F41A4 File Offset: 0x000F23A4
 public void Initialize(int w, int h)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitializeInt32Int32_hotfix != null)
     {
         this.m_InitializeInt32Int32_hotfix.call(new object[]
         {
             this,
             w,
             h
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     this.m_width  = w;
     this.m_height = h;
     this.m_cells  = new BattleMapCell[h, w];
     for (int i = 0; i < h; i++)
     {
         for (int j = 0; j < w; j++)
         {
             BattleMapCell battleMapCell = new BattleMapCell();
             this.m_cells[i, j] = battleMapCell;
         }
     }
 }
Example #4
0
        // Token: 0x060036F4 RID: 14068 RVA: 0x000F4638 File Offset: 0x000F2838
        public void SetActor(GridPosition p, BattleActor actor)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetActorGridPositionBattleActor_hotfix != null)
            {
                this.m_SetActorGridPositionBattleActor_hotfix.call(new object[]
                {
                    this,
                    p,
                    actor
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return;
            }
            if (actor != null && cell.m_actor != null)
            {
                DebugUtility.LogError(string.Format("BattleMap.SetActor() error, {0} already has actor {1}", p, cell.m_actor.Id));
            }
            cell.m_actor = actor;
        }
Example #5
0
        // Token: 0x060036F9 RID: 14073 RVA: 0x000F4964 File Offset: 0x000F2B64
        public int GetRegion(GridPosition p)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetRegionGridPosition_hotfix != null)
            {
                return(Convert.ToInt32(this.m_GetRegionGridPosition_hotfix.call(new object[]
                {
                    this,
                    p
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return(0);
            }
            return(cell.m_region);
        }
Example #6
0
        // Token: 0x060036F7 RID: 14071 RVA: 0x000F4838 File Offset: 0x000F2A38
        public ConfigDataTerrainInfo GetTerrain(GridPosition p)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetTerrainGridPosition_hotfix != null)
            {
                return((ConfigDataTerrainInfo)this.m_GetTerrainGridPosition_hotfix.call(new object[]
                {
                    this,
                    p
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return(null);
            }
            return(cell.m_terrain);
        }
Example #7
0
        // Token: 0x060036F5 RID: 14069 RVA: 0x000F4704 File Offset: 0x000F2904
        public BattleActor GetActor(GridPosition p)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetActorGridPosition_hotfix != null)
            {
                return((BattleActor)this.m_GetActorGridPosition_hotfix.call(new object[]
                {
                    this,
                    p
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return(null);
            }
            return(cell.m_actor);
        }
Example #8
0
        // Token: 0x060036FD RID: 14077 RVA: 0x000F4BF8 File Offset: 0x000F2DF8
        public int GetMovePointCost(GridPosition p, MoveType moveType)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetMovePointCostGridPositionMoveType_hotfix != null)
            {
                return(Convert.ToInt32(this.m_GetMovePointCostGridPositionMoveType_hotfix.call(new object[]
                {
                    this,
                    p,
                    moveType
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return(0);
            }
            return(BattleMap.GetMovePointCost(cell.m_terrain, moveType));
        }
Example #9
0
        // Token: 0x060036F8 RID: 14072 RVA: 0x000F48CC File Offset: 0x000F2ACC
        public void SetRegion(GridPosition p, int region)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetRegionGridPositionInt32_hotfix != null)
            {
                this.m_SetRegionGridPositionInt32_hotfix.call(new object[]
                {
                    this,
                    p,
                    region
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return;
            }
            cell.m_region = region;
        }
Example #10
0
        // Token: 0x060036FC RID: 14076 RVA: 0x000F4B44 File Offset: 0x000F2D44
        public bool HasRegionBit(GridPosition p, int bit)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_HasRegionBitGridPositionInt32_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_HasRegionBitGridPositionInt32_hotfix.call(new object[]
                {
                    this,
                    p,
                    bit
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return(false);
            }
            int num = 1 << bit;

            return((cell.m_region & num) != 0);
        }
Example #11
0
        // Token: 0x060036FB RID: 14075 RVA: 0x000F4A9C File Offset: 0x000F2C9C
        public void ClearRegionBit(GridPosition p, int bit)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ClearRegionBitGridPositionInt32_hotfix != null)
            {
                this.m_ClearRegionBitGridPositionInt32_hotfix.call(new object[]
                {
                    this,
                    p,
                    bit
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return;
            }
            int num = 1 << bit;

            cell.m_region &= ~num;
        }
Example #12
0
 // Token: 0x060036EC RID: 14060 RVA: 0x000F412C File Offset: 0x000F232C
 public LuaExportHelper(BattleMapCell owner)
 {
     this.m_owner = owner;
 }