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


C# IntVec3.ToString方法代码示例

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


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

示例1: TreatIntrusion

 public void TreatIntrusion(IntVec3 intrusionCell)
 {
     SetOutpostSecurityForcesHostileToColony();
     string text = "   MiningCo. security message broadcast\n\n" +
         "Coralie here!\n" +
         "I have detected an intrusion in sub-sector " + intrusionCell.ToString() + ".\n\n" +
         "To all units in the sector, code Red is activated. All intruders are now priority targets.\n\n" +
         "--- End of transmission ---";
     Find.LetterStack.ReceiveLetter("Intrusion", text, LetterType.BadUrgent, new TargetInfo(intrusionCell));
 }
开发者ID:Rikiki123456789,项目名称:Rimworld,代码行数:10,代码来源:Building_OutpostCommandConsole.cs

示例2: AllowsPlacing

        public override AcceptanceReport AllowsPlacing(BuildableDef checkingDef, IntVec3 loc, Rot4 rot)
        {
            ThingDef addonDef = (ThingDef)checkingDef;
            if (addonDef == null)
            {
                return (AcceptanceReport)("MessagePlacementNotHere".Translate());
            }
            ThingWithComps addonsHost = (ThingWithComps)loc.GetThingList().Where(x => x.TryGetComp<CompAffectedByFacilities>() != null).FirstOrDefault();
            if (addonsHost == null)
            {
                return (AcceptanceReport)("MessagePlacementNotHere".Translate());
            }

            ThingWithComps addonsCarrier = (ThingWithComps)loc.GetThingList().Where(x => x.TryGetComp<CompAddons>() != null).FirstOrDefault();
            if (addonsCarrier != null)
            {
                return (AcceptanceReport)("MessagePlacementNotHere".Translate());
            }

            var thingDef = checkingDef as ThingDef;
            if (thingDef != null && addonsHost!=null)
            {
                rot = addonsHost.Rotation;
                CompProperties_Addons ProComp = thingDef.CompDefFor<CompAddons>() as CompProperties_Addons;
                Log.Message("comprops" + ProComp.SlotNum);
                if (ProComp != null)
                {
                    if (ProComp.SlotNum >= 0)
                    {
                        List<IntVec3> VecList = new List<IntVec3>();
                        VecList = addonsHost.OccupiedRect().Cells.ToList();
                        int CalcCell = ProComp.SlotNum;
                        if (VecList.Count > 1)
                        {
                            if (addonsHost.Rotation == Rot4.North)
                            {
                                if (CalcCell + addonsHost.def.size.x <= VecList.Count)
                                {
                                    CalcCell += addonsHost.def.size.x;
                                }
                            }
                            else if (addonsHost.Rotation == Rot4.West)
                            {
                                if (CalcCell + addonsHost.def.size.z <= VecList.Count)
                                {
                                    CalcCell += addonsHost.def.size.z;
                                }
                            }
                            else if (addonsHost.Rotation == Rot4.East)
                            {
                                if (CalcCell + addonsHost.def.size.z >= 0)
                                {
                                    CalcCell -= addonsHost.def.size.z;
                                }
                            }
                        }

                        if (VecList.ElementAt(CalcCell) == loc)
                        {
                            return AcceptanceReport.WasAccepted;
                        }
                        Log.Message("loc=" + loc.ToString());
                    }

                }

            }

            return (AcceptanceReport)("MessagePlacementNotHere".Translate());
        }
开发者ID:isistoy,项目名称:DevLib,代码行数:70,代码来源:PlaceWorker_OnAddonsHost.cs


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