当前位置: 首页>>代码示例>>C#>>正文


C# Building.GetLastFrameData方法代码示例

本文整理汇总了C#中Building.GetLastFrameData方法的典型用法代码示例。如果您正苦于以下问题:C# Building.GetLastFrameData方法的具体用法?C# Building.GetLastFrameData怎么用?C# Building.GetLastFrameData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Building的用法示例。


在下文中一共展示了Building.GetLastFrameData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExtinguishFire

 private bool ExtinguishFire(ushort vehicleID, ref Vehicle data, ushort buildingID, ref Building buildingData)
 {
     int width = buildingData.Width;
     int length = buildingData.Length;
     int num = Mathf.Min(5000, (int)buildingData.m_fireIntensity * (width * length));
     if (num != 0 && Singleton<SimulationManager>.instance.m_randomizer.Int32(8u) == 0)
     {
         num = Mathf.Max(num - this.m_fireFightingRate, 0);
         num /= width * length;
         buildingData.m_fireIntensity = (byte)num;
         if (num == 0)
         {
             if (data.m_sourceBuilding != 0)
             {
                 int tempExport = (int)Singleton<BuildingManager>.instance.m_buildings.m_buffer[(int)data.m_sourceBuilding].m_tempExport;
                 Singleton<BuildingManager>.instance.m_buildings.m_buffer[(int)data.m_sourceBuilding].m_tempExport = (byte)Mathf.Min(tempExport + 1, 255);
             }
             Building.Flags flags = buildingData.m_flags;
             if (buildingData.m_productionRate != 0)
             {
                 buildingData.m_flags |= Building.Flags.Active;
             }
             Building.Flags flags2 = buildingData.m_flags;
             Singleton<BuildingManager>.instance.UpdateBuildingRenderer(buildingID, buildingData.GetLastFrameData().m_fireDamage == 0);
             if (flags2 != flags)
             {
                 Singleton<BuildingManager>.instance.UpdateFlags(buildingID, flags2 ^ flags);
             }
             GuideController properties = Singleton<GuideManager>.instance.m_properties;
             if (properties != null)
             {
                 Singleton<BuildingManager>.instance.m_buildingOnFire.Deactivate(buildingID, false);
             }
         }
     }
     return num == 0;
 }
开发者ID:moverperfect,项目名称:csl-traffic,代码行数:37,代码来源:CustomFireTruckAI.cs

示例2: ExtraTrySpreadFire

 private void ExtraTrySpreadFire(Quad2 quad, float minY, float maxY, ushort buildingID, ref Building buildingData)
 {
     BuildingInfo info = buildingData.Info;
     int num;
     int num2;
     int num3;
     info.m_buildingAI.GetFireParameters(buildingID, ref buildingData, out num, out num2, out num3);
     ItemClass.CollisionType tmpIC = 0;
     if (num != 0 && (buildingData.m_flags & (Building.Flags.Completed | Building.Flags.Abandoned)) == Building.Flags.Completed
         && buildingData.m_fireIntensity == 0 && buildingData.GetLastFrameData().m_fireDamage == 0 && buildingData.OverlapQuad( buildingID, quad, minY, maxY,tmpIC))
     {
         if (fireSet.Contains(buildingID))
         {
             return;
         }
         else
         {
             var temp = "";
             foreach (ushort fs in fireSet)
             {
                 temp += fs.ToString();
             }
             fireQueue.Enqueue(buildingID);
             fireSet.Add(buildingID);
             if (fireSet.Count > 50)
             {
                 fireSet.Remove(fireQueue.Dequeue());
             }
         }
         float num4 = Singleton<TerrainManager>.instance.WaterLevel(VectorUtils.XZ(buildingData.m_position));
         if (num4 <= buildingData.m_position.y)
         {
             Building.Flags flags = buildingData.m_flags;
             buildingData.m_fireIntensity = (byte)num2;
             info.m_buildingAI.BuildingDeactivated(buildingID, ref buildingData);
             Building.Flags flags2 = buildingData.m_flags;
             Singleton<BuildingManager>.instance.UpdateBuildingRenderer(buildingID, true);
             if (flags2 != flags)
             {
                 Singleton<BuildingManager>.instance.UpdateFlags(buildingID, flags2 ^ flags);
             }
         }
     }
 }
开发者ID:Knighth,项目名称:Cities-Skyline-Proper-Hardness,代码行数:44,代码来源:FireSpread.cs

示例3: LightBuildingOnFire

        internal static void LightBuildingOnFire(ushort buildingId, ref Building data)
        {
            var bm = Singleton<BuildingManager>.instance;

            if ((bm.m_buildings.m_buffer[buildingId].m_problems & Notification.Problem.Fire) != 0)
            {
                return;
            }

            int fireHazard;
            int fireSize;
            int fireTolerance;
            bm.m_buildings.m_buffer[buildingId].Info.m_buildingAI.GetFireParameters(buildingId, ref data, out fireHazard, out fireSize, out fireTolerance);

            if (fireHazard != 0 && (data.m_flags & (Building.Flags.Abandoned | Building.Flags.Completed)) == Building.Flags.Completed && data.m_fireIntensity == 0 &&
                data.GetLastFrameData().m_fireDamage == 0)
            {
                // Is the building under water by chance?
                float waterLevel = Singleton<TerrainManager>.instance.WaterLevel(new Vector2(data.m_position.x, data.m_position.z));
                if (waterLevel <= data.m_position.y)
                {
                    Building.Flags preDeactivateFlags = data.m_flags;
                    data.m_fireIntensity = (byte) fireSize;
                    data.Info.m_buildingAI.BuildingDeactivated(buildingId, ref data);
                    Building.Flags postDeactivateFlags = data.m_flags;
                    Singleton<BuildingManager>.instance.UpdateBuildingRenderer(buildingId, true);
                    if (postDeactivateFlags != preDeactivateFlags)
                    {
                        Singleton<BuildingManager>.instance.UpdateFlags(buildingId, postDeactivateFlags ^ preDeactivateFlags);
                    }
                }
            }
        }
开发者ID:psydox,项目名称:CitiesSkylinesMods,代码行数:33,代码来源:FireSpread.cs


注:本文中的Building.GetLastFrameData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。