• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ItemClass类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ItemClass的典型用法代码示例。如果您正苦于以下问题:C# ItemClass类的具体用法?C# ItemClass怎么用?C# ItemClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ItemClass类属于命名空间,在下文中一共展示了ItemClass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DeepClone_ClassWithFieldsRef_AsReference

		public void DeepClone_ClassWithFieldsRef_AsReference(TypeModel model)
		{
			var classWithFields = new ClassWithFieldsRef();
			var item = new ItemClass() { Message = "Hi there!" };
			classWithFields._item1 = item;
			classWithFields._item2 = item;
			var list = new List<int> { 2, 4, 5 };
			classWithFields._list1 = list;
			classWithFields._list2 = list;

			var clone = (ClassWithFieldsRef)model.DeepClone(classWithFields);

			Assert.AreEqual(classWithFields._item1.Message, clone._item1.Message);
			Assert.AreEqual(classWithFields._item2.Message, clone._item2.Message);

			Assert.AreEqual(classWithFields._list1.Count, clone._list1.Count);
			for (int i = 0; i < classWithFields._list1.Count; i++)
			{
				Assert.AreEqual(classWithFields._list1[i], clone._list1[i]);
			}

			Assert.AreEqual(classWithFields._list2.Count, clone._list2.Count);
			for (int i = 0; i < classWithFields._list2.Count; i++)
			{
				Assert.AreEqual(classWithFields._list2[i], clone._list2[i]);
			}

			Assert.IsTrue(object.ReferenceEquals(classWithFields._item1, classWithFields._item2));
			Assert.IsTrue(object.ReferenceEquals(classWithFields._list1, classWithFields._list2));
			Assert.IsTrue(object.ReferenceEquals(clone._item1, clone._item2));
			Assert.IsTrue(object.ReferenceEquals(clone._list1, clone._list2));
		}
开发者ID:JayCap,项目名称:Protobuf-net-Patch-and-T4-TypeModel-Generator,代码行数:32,代码来源:Core_Fields.cs


示例2: ItemType

 public ItemType(string name, ItemClass itemClass, int weight, int price = 0)
 {
     Name = name;
     Class = itemClass;
     Weight = weight;
     Price = price;
 }
开发者ID:ZeroByte1987,项目名称:ConsoleGames,代码行数:7,代码来源:ItemType.cs


示例3: DeepClone_DictionaryOfClassRef_AsReference

		public void DeepClone_DictionaryOfClassRef_AsReference(TypeModel model)
		{
			var itemClass = new ItemClass() { Message = "hello"};

			var dictionary = new DictionaryOfClass()
			{
				Collection = new Dictionary<int, ItemClass>
				{
				    { 1, itemClass },   
					{ 2, itemClass }
				}
			};

			var clone = (DictionaryOfClass)model.DeepClone(dictionary);

			Assert.AreEqual(dictionary.Collection.Count, clone.Collection.Count);

			foreach (var key in dictionary.Collection.Keys)
			{
				Assert.AreEqual(dictionary.Collection[key].Message, clone.Collection[key].Message);
			}

			Assert.IsTrue(object.ReferenceEquals(dictionary.Collection[1], dictionary.Collection[2]), "Original reference failed");
			Assert.IsTrue(object.ReferenceEquals(clone.Collection[1], clone.Collection[2]), "Clone reference not maintained");
		}
开发者ID:JayCap,项目名称:Protobuf-net-Patch-and-T4-TypeModel-Generator,代码行数:25,代码来源:Core_Collection.cs


示例4: CreatePath

        public new bool CreatePath(out uint unit, ref Randomizer randomizer, uint buildIndex, PathUnit.Position startPosA, PathUnit.Position startPosB, PathUnit.Position endPosA, PathUnit.Position endPosB, PathUnit.Position vehiclePosition, NetInfo.LaneType laneTypes, VehicleInfo.VehicleType vehicleTypes, float maxLength, bool isHeavyVehicle, bool ignoreBlocked, bool stablePath, bool skipQueue, ItemClass.Service vehicleService)
        {
            while (!Monitor.TryEnter(this.m_bufferLock, SimulationManager.SYNCHRONIZE_TIMEOUT))
            {
            }
            uint num;
            try
            {
                if (!this.m_pathUnits.CreateItem(out num, ref randomizer))
                {
                    unit = 0u;
                    bool result = false;
                    return result;
                }
                this.m_pathUnitCount = (int)(this.m_pathUnits.ItemCount() - 1u);
            }
            finally
            {
                Monitor.Exit(this.m_bufferLock);
            }
            unit = num;

            byte simulationFlags = createSimulationFlag(isHeavyVehicle, ignoreBlocked, stablePath, vehicleService);
            assignPathProperties(unit, buildIndex, startPosA, startPosB, endPosA, endPosB, vehiclePosition, laneTypes, vehicleTypes, maxLength, simulationFlags);

            return findShortestPath(unit, skipQueue);
        }
开发者ID:robbiemu,项目名称:Skylines-Traffic-Manager,代码行数:27,代码来源:CustomPathManager.cs


示例5: DeepClone_ClassFieldMaintainsReference

		public void DeepClone_ClassFieldMaintainsReference(TypeModel model)
		{
			var item = new ItemClass() { Message = "Bob yo" };

			var container = new ContainerItemClass()
			{
				Item1 = item,
				Item2 = item
			};

			var clone = (ContainerItemClass)model.DeepClone(container);

			Assert.IsTrue(object.ReferenceEquals(container.Item1, container.Item2));
			Assert.IsTrue(object.ReferenceEquals(clone.Item1, clone.Item2));

			Assert.AreEqual(container.Item1.Message, clone.Item1.Message);
			Assert.AreEqual(container.Item2.Message, clone.Item2.Message);

			container.Item1.Message = "New original";
			clone.Item1.Message = "New clone";

			Assert.AreEqual(container.Item1.Message, container.Item2.Message);
			Assert.AreEqual(clone.Item1.Message, clone.Item2.Message);

			container.Item2.Message = "New original 2";
			clone.Item2.Message = "New clone 2";

			Assert.AreEqual(container.Item1.Message, container.Item2.Message);
			Assert.AreEqual(clone.Item1.Message, clone.Item2.Message);
		}
开发者ID:JayCap,项目名称:Protobuf-net-Patch-and-T4-TypeModel-Generator,代码行数:30,代码来源:Core_Container.cs


示例6: Add

    public bool Add(ItemClass item, int amount, int foodType, int index = 0)
    {
        if (Type == InventoryType.MULTIPLE) {
            if (index < 0 || index >= Size) return false;
            if (Items[index].item_id > -1 &&  Items[index].item_id != item.item_id) return false;

            Items[index].Update(item.item_id, amount);

            AddCollection(item, amount, foodType);
            return true;

        }

        foreach (InventoryItem inve in Items.Values) {
            if (inve.item_id != item.item_id) continue;
            inve.Update(item.item_id, amount);
            AddCollection(item, amount, foodType);
            return true;
        }

        foreach (InventoryItem inve in Items.Values) {
            if (inve.item_id != -1) continue;
            inve.Update(item.item_id, amount);
            AddCollection(item, amount, foodType);
            return true;
        }

        return false;
    }
开发者ID:raimis001,项目名称:raWorld,代码行数:29,代码来源:Inventory.cs


示例7: Item

        /// <summary>
        /// Initializes a new instance of the Item class.
        /// </summary>
        /// <param name="itemTypeId">The ID of the item to create.</param>
        /// <param name="itemClass">The type of item that this is.</param>
        /// <param name="name">The item's name.</param>
        /// <param name="description">The item's description.</param>
        /// <exception cref="System.ArgumentNullException">Any parameter is null.</exception>
        /// <exception cref="System.ArgumentOutOfRangeException">Item type ID is less than zero.</exception>
        /// <exception cref="System.ArgumentException">Item class is ItemClass.Undefined.</exception>
        protected Item(long itemTypeId, ItemClass itemClass, string name, string description)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (description == null)
            {
                throw new ArgumentNullException("description");
            }

            if (itemTypeId < 0)
            {
                throw new ArgumentOutOfRangeException("itemTypeId", "must be greater than or equal to zero.");
            }

            if (itemClass == ItemClass.Undefined)
            {
                throw new ArgumentException("cannot be ItemClass.Undefined", "itemClass");
            }

            this.ItemTypeId = itemTypeId;
            this.ItemClass = itemClass;
            this.Name = name;
            this.Description = description;
        }
开发者ID:jakepetroules,项目名称:jakes-3d-mmo,代码行数:37,代码来源:Item.cs


示例8: DeepCloneMaintainReference

		public void DeepCloneMaintainReference(TypeModel model)
		{
			var collection = new List<ItemClass>() { new ItemClass() { Message = "Hello" } };
			var itemClass = new ItemClass() { Message = "Haha" };

			var obj = new ComplexTestOfMaintainedReference()
			{
				Collection1 = collection,
				Collection2 = collection,
				Item1 = itemClass,
				Item2 = itemClass,
				Primitive1 = 1,
				Primitive2 = 2,
				String1 = "Test"
			};

			var clone = (ComplexTestOfMaintainedReference)model.DeepClone(obj);

			Assert.AreEqual(obj.Collection1.Count, clone.Collection1.Count);
			Assert.AreEqual(obj.Collection1[0].Message, clone.Collection1[0].Message);

			Assert.AreEqual(obj.Collection2.Count, clone.Collection2.Count);
			Assert.AreEqual(obj.Collection2[0].Message, clone.Collection2[0].Message);

			Assert.IsTrue(object.ReferenceEquals(clone.Collection1, clone.Collection2), "Collection reference");

			Assert.AreEqual(obj.Item1.Message, clone.Item1.Message);
			Assert.AreEqual(obj.Item2.Message, clone.Item2.Message);

			Assert.IsTrue(object.ReferenceEquals(clone.Item1, clone.Item2), "Item reference");

			Assert.AreEqual(obj.Primitive1, clone.Primitive1);
			Assert.AreEqual(obj.Primitive2, clone.Primitive2);
			Assert.AreEqual(obj.String1, clone.String1);
		}
开发者ID:JayCap,项目名称:Protobuf-net-Patch-and-T4-TypeModel-Generator,代码行数:35,代码来源:Core_AutoProperties.cs


示例9: Item

 public Item(ItemClass type, int amount)
     : base(ThingType.OBJECT_ITEM)
 {
     mType=type;
     mAmount=amount;
     mLifetime = Configuration.getValue("game_floorItemDecayTime", 0) * 10;
 }
开发者ID:Invertika,项目名称:server,代码行数:7,代码来源:Item.cs


示例10: GetRandomBuildingInfo_Upgrade

        // Called every frame on building upgrade
        public static BuildingInfo GetRandomBuildingInfo_Upgrade(Vector3 position, ushort prefabIndex, ref Randomizer r, ItemClass.Service service, ItemClass.SubService subService, ItemClass.Level level, int width, int length, BuildingInfo.ZoningMode zoningMode, int style)
        {
            // This method is very fragile, no logging here!
            
            var districtId = Singleton<DistrictManager>.instance.GetDistrict(position);

            // See if there is a special upgraded building
            var buildingInfo = BuildingThemesManager.instance.GetUpgradeBuildingInfo(prefabIndex, districtId);
            if (buildingInfo != null) 
            {
                return buildingInfo;
            }

            var areaIndex = BuildingThemesManager.GetAreaIndex(service, subService, level, width, length, zoningMode);

            // list of possible prefabs
            var fastList = Singleton<BuildingThemesManager>.instance.GetAreaBuildings(districtId, areaIndex);

            if (fastList == null || fastList.m_size == 0)
            {
                return (BuildingInfo)null;
            }

            // select a random prefab from the list
            int index = r.Int32((uint)fastList.m_size);
            return PrefabCollection<BuildingInfo>.GetPrefab((uint)fastList.m_buffer[index]);
        }
开发者ID:aoighost,项目名称:BuildingThemes,代码行数:28,代码来源:BuildingManagerDetour.cs


示例11: FindCargoParent

 private static ushort FindCargoParent(ushort sourceBuilding, ushort targetBuilding, ItemClass.Service service, ItemClass.SubService subService)
 {
     BuildingManager instance = Singleton<BuildingManager>.instance;
     VehicleManager instance2 = Singleton<VehicleManager>.instance;
     ushort num = instance.m_buildings.m_buffer [(int)sourceBuilding].m_ownVehicles;
     int num2 = 0;
     while (num != 0)
     {
         if (instance2.m_vehicles.m_buffer [(int)num].m_targetBuilding == targetBuilding && (instance2.m_vehicles.m_buffer [(int)num].m_flags & Vehicle.Flags.WaitingCargo) != Vehicle.Flags.None)
         {
             VehicleInfo info = instance2.m_vehicles.m_buffer [(int)num].Info;
             if (info.m_class.m_service == service && info.m_class.m_subService == subService)
             {
                 int num3;
                 int num4;
                 info.m_vehicleAI.GetSize (num, ref instance2.m_vehicles.m_buffer [(int)num], out num3, out num4);
                 if (num3 < num4)
                 {
                     return num;
                 }
             }
         }
         num = instance2.m_vehicles.m_buffer [(int)num].m_nextOwnVehicle;
         if (++num2 >= 65536)
         {
             CODebugBase<LogChannel>.Error (LogChannel.Core, "Invalid list detected!\n" + Environment.StackTrace);
             break;
         }
     }
     return 0;
 }
开发者ID:klyte45,项目名称:CS-VehicleLimitExpander,代码行数:31,代码来源:FakeCargoTruckAI.cs


示例12: FindNextCargoParent

 public static ushort FindNextCargoParent(ushort sourceBuilding, ItemClass.Service service, ItemClass.SubService subService)
 {
     BuildingManager instance = Singleton<BuildingManager>.instance;
     VehicleManager instance2 = Singleton<VehicleManager>.instance;
     ushort num = instance.m_buildings.m_buffer [(int)sourceBuilding].m_ownVehicles;
     ushort result = 0;
     int num2 = -1;
     int num3 = 0;
     while (num != 0) {
         if ((instance2.m_vehicles.m_buffer [(int)num].m_flags & Vehicle.Flags.WaitingCargo) != Vehicle.Flags.None) {
             VehicleInfo info = instance2.m_vehicles.m_buffer [(int)num].Info;
             if (info.m_class.m_service == service && info.m_class.m_subService == subService) {
                 int num4;
                 int b;
                 info.m_vehicleAI.GetSize (num, ref instance2.m_vehicles.m_buffer [(int)num], out num4, out b);
                 int num5 = Mathf.Max (num4 * 255 / Mathf.Max (1, b), (int)instance2.m_vehicles.m_buffer [(int)num].m_waitCounter);
                 if (num5 > num2) {
                     result = num;
                     num2 = num5;
                 }
             }
         }
         num = instance2.m_vehicles.m_buffer [(int)num].m_nextOwnVehicle;
         if (++num3 >= 65536) {
             CODebugBase<LogChannel>.Error (LogChannel.Core, "Invalid list detected!\n" + Environment.StackTrace);
             break;
         }
     }
     return result;
 }
开发者ID:klyte45,项目名称:CS-VehicleLimitExpander,代码行数:30,代码来源:FakeCargoTruckAI.cs


示例13: FindPathPosition

 public static bool FindPathPosition(Vector3 position, ItemClass.Service service, NetInfo.LaneType laneType, VehicleInfo.VehicleType vehicleTypes, bool allowUnderground, bool requireConnect, float maxDistance, out PathUnit.Position pathPos, RoadManager.VehicleType vehicleType)
 {
     PathUnit.Position position2;
     float num;
     float num2;
     return CustomPathManager.FindPathPosition(position, service, laneType, vehicleTypes, allowUnderground, requireConnect, maxDistance, out pathPos, out position2, out num, out num2, vehicleType);
 }
开发者ID:Rovanion,项目名称:csl-traffic,代码行数:7,代码来源:CustomPathManager.cs


示例14: Munition

 /// <summary>
 /// Initializes a new instance of the Munition class.
 /// Any out-of-range arguments will be clamped into the proper range automatically.
 /// </summary>
 /// <param name="itemTypeId">The ID of the item to create.</param>
 /// <param name="itemClass">The type of item that this is.</param>
 /// <param name="name">The item's name.</param>
 /// <param name="description">The item's description.</param>
 /// <param name="weight">The weight of the munition.</param>
 /// <param name="integrity">The munition's current integrity.</param>
 /// <param name="maximumIntegrity">The munition's maximum integrity.</param>
 /// <param name="integrityLevel">The munition's integrity level.</param>
 /// <param name="evasionBonus">The munition's evasion bonus.</param>
 /// <exception cref="System.ArgumentNullException">Any parameter is null.</exception>
 /// <exception cref="System.ArgumentOutOfRangeException">ItemTypeId is less than zero.</exception>
 /// <exception cref="System.ArgumentException">ItemClass is ItemClass.Undefined.</exception>
 protected Munition(long itemTypeId, ItemClass itemClass, string name, string description, float weight, short integrity, short maximumIntegrity, byte integrityLevel, byte evasionBonus)
     : base(itemTypeId, itemClass, name, description)
 {
     this.Weight = weight;
     this.Integrity = integrity;
     this.MaximumIntegrity = maximumIntegrity;
     this.IntegrityLevel = integrityLevel;
     this.EvasionBonus = evasionBonus;
 }
开发者ID:jakepetroules,项目名称:jakes-3d-mmo,代码行数:25,代码来源:Munition.cs


示例15: EquipmentSlot

 public EquipmentSlot(int id, StringName sn, ItemClass[] itemClass, SlotType slot)
 {
     _id = id;
     _displayedName = sn;
     _allowedItemType = new ItemClass[itemClass.GetLength(0)];
     _allowedItemType = itemClass;
     _item = null;
     _fullInfo = "-";
     _slotType = slot;
 }
开发者ID:Gnusznak,项目名称:CrystalsOfTime,代码行数:10,代码来源:EquipmentSlot.cs


示例16: CalculateHomeCount

        /// <summary>
        /// Calculated to the similar way the original code would have done it
        /// </summary>
        /// <param name="r"></param>
        /// <param name="width"></param>
        /// <param name="length"></param>
        /// <param name="subService"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static int CalculateHomeCount(Randomizer r, int width, int length, ItemClass.SubService subService, ItemClass.Level level)
        {
            int[][] residentialArray = { new int [] { 20, 25, 30, 35, 40 },
                                         new int [] { 60, 100, 130, 150, 160 } };

            int iLevel = (int)(level >= 0 ? level : 0);
            int density = (subService == ItemClass.SubService.ResidentialLow) ? 0 : 1;
            int num = residentialArray[density][iLevel];
            return Mathf.Max(100, width * length * num + r.Int32(100u)) / 100;
        }
开发者ID:OMMatte,项目名称:WG_RealisticCitySkylines,代码行数:19,代码来源:Game_ResidentialAI.cs


示例17: CheckZoning

 public static bool CheckZoning(Building b, ItemClass.Zone zone)
 {
     int width = b.Width;
     int length = b.Length;
     Vector3 vector3_1 = new Vector3(Mathf.Cos(b.m_angle), 0.0f, Mathf.Sin(b.m_angle));
     Vector3 vector3_2 = new Vector3(vector3_1.z, 0.0f, -vector3_1.x);
     Vector3 vector3_3 = vector3_1 * ((float)width * 4f);
     Vector3 vector3_4 = vector3_2 * ((float)length * 4f);
     Quad3 quad3 = new Quad3();
     quad3.a = b.m_position - vector3_3 - vector3_4;
     quad3.b = b.m_position + vector3_3 - vector3_4;
     quad3.c = b.m_position + vector3_3 + vector3_4;
     quad3.d = b.m_position - vector3_3 + vector3_4;
     Vector3 vector3_5 = quad3.Min();
     Vector3 vector3_6 = quad3.Max();
     int num1= Mathf.Max((int)((vector3_5.x - 46f) / 64f + FakeZoneManager.HALFGRID), 0);
     int num2 = Mathf.Max((int)((vector3_5.z - 46f) / 64f + FakeZoneManager.HALFGRID), 0);
     int num3 = Mathf.Min((int)((vector3_6.x + 46f) / 64f + FakeZoneManager.HALFGRID), FakeZoneManager.GRIDSIZE - 1);
     int num4 = Mathf.Min((int)((vector3_6.z + 46f) / 64f + FakeZoneManager.HALFGRID), FakeZoneManager.GRIDSIZE - 1);
     uint validCells = 0U;
     ZoneManager instance = Singleton<ZoneManager>.instance;
     for (int index1 = num2; index1 <= num4; ++index1)
     {
         for (int index2 = num1; index2 <= num3; ++index2)
         {
             ushort num5 = FakeZoneManager.zoneGrid[index1 * FakeZoneManager.GRIDSIZE + index2];
             int num6 = 0;
             while ((int)num5 != 0)
             {
                 Vector3 vector3_7 = instance.m_blocks.m_buffer[(int)num5].m_position;
                 if ((double)Mathf.Max(Mathf.Max(vector3_5.x - 46f - vector3_7.x, vector3_5.z - 46f - vector3_7.z), Mathf.Max((float)((double)vector3_7.x - (double)vector3_6.x - 46.0), (float)((double)vector3_7.z - (double)vector3_6.z - 46.0))) < 0.0)
                     CheckZoning(b,zone, ref validCells, ref instance.m_blocks.m_buffer[num5]);
                 num5 = instance.m_blocks.m_buffer[(int)num5].m_nextGridBlock;
                 if (++num6 >= 32768)
                 {
                     CODebugBase<LogChannel>.Error(LogChannel.Core, "Invalid list detected!\n" + System.Environment.StackTrace);
                     break;
                 }
             }
         }
     }
     for (int index1 = 0; index1 < length; ++index1)
     {
         for (int index2 = 0; index2 < width; ++index2)
         {
             if (((int)validCells & 1 << (index1 << 3) + index2) == 0)
                 return false;
         }
     }
     return true;
 }
开发者ID:EmperorOfDoom,项目名称:cities-skylines-unlimiter-1,代码行数:51,代码来源:FakeBuilding.cs


示例18: DeepClone_KeyValuePairWithRef

		public void DeepClone_KeyValuePairWithRef(TypeModel model)
		{
			var itemClass = new ItemClass() { Message = "ABC" };
			var obj = new KeyValuePairWrapper()
			{
				Reference = new KeyValuePair<IItemClass, IItemClass>(itemClass, itemClass)
			};

			var clone = (KeyValuePairWrapper)model.DeepClone(obj);

			Assert.AreEqual(obj.Reference.Key.Message, clone.Reference.Key.Message);

			Assert.IsTrue(object.ReferenceEquals(obj.Reference.Key, obj.Reference.Value), "Original reference failed");
			Assert.IsTrue(object.ReferenceEquals(clone.Reference.Key, clone.Reference.Value), "Clone reference not maintained");
		}
开发者ID:JayCap,项目名称:Protobuf-net-Patch-and-T4-TypeModel-Generator,代码行数:15,代码来源:Core_KeyValuePair.cs


示例19: CheckZoning

 private static void CheckZoning(ref Building _this, ItemClass.Zone zone1, ItemClass.Zone zone2, ref uint validCells, ref bool secondary, ref ZoneBlock block)
 {
     BuildingInfo.ZoningMode zoningMode = _this.Info.m_zoningMode;
     int width = _this.Width;
     int length = _this.Length;
     Vector3 vector3_1 = new Vector3(Mathf.Cos(_this.m_angle), 0.0f, Mathf.Sin(_this.m_angle)) * 8f;
     Vector3 vector3_2 = new Vector3(vector3_1.z, 0.0f, -vector3_1.x);
     int rowCount = block.RowCount;
     int columnCount = ZoneBlockDetour.GetColumnCount(ref block); // modified
     Vector3 vector3_3 = new Vector3(Mathf.Cos(block.m_angle), 0.0f, Mathf.Sin(block.m_angle)) * 8f;
     Vector3 vector3_4 = new Vector3(vector3_3.z, 0.0f, -vector3_3.x);
     Vector3 vector3_5 = block.m_position - _this.m_position + vector3_1 * (float)((double)width * 0.5 - 0.5) + vector3_2 * (float)((double)length * 0.5 - 0.5);
     for (int z = 0; z < rowCount; ++z)
     {
         Vector3 vector3_6 = ((float)z - 3.5f) * vector3_4;
         for (int x = 0; (long)x < columnCount; ++x) // modified
         {
             if (((long)block.m_valid & ~(long)block.m_shared & 1L << (z << 3 | x)) != 0L)
             {
                 ItemClass.Zone zone = block.GetZone(x, z);
                 bool flag1 = zone == zone1;
                 if (zone == zone2 && zone2 != ItemClass.Zone.None)
                 {
                     flag1 = true;
                     secondary = true;
                 }
                 if (flag1)
                 {
                     Vector3 vector3_7 = ((float)x - 3.5f) * vector3_3;
                     Vector3 vector3_8 = vector3_5 + vector3_7 + vector3_6;
                     float num1 = (float)((double)vector3_1.x * (double)vector3_8.x + (double)vector3_1.z * (double)vector3_8.z);
                     float num2 = (float)((double)vector3_2.x * (double)vector3_8.x + (double)vector3_2.z * (double)vector3_8.z);
                     int num3 = Mathf.RoundToInt(num1 / 64f);
                     int num4 = Mathf.RoundToInt(num2 / 64f);
                     bool flag2 = false;
                     if (zoningMode == BuildingInfo.ZoningMode.Straight)
                         flag2 = num4 == 0;
                     else if (zoningMode == BuildingInfo.ZoningMode.CornerLeft)
                         flag2 = num4 == 0 && num3 >= width - 2 || num4 <= 1 && num3 == width - 1;
                     else if (zoningMode == BuildingInfo.ZoningMode.CornerRight)
                         flag2 = num4 == 0 && num3 <= 1 || num4 <= 1 && num3 == 0;
                     if ((!flag2 || x == 0) && (num3 >= 0 && num4 >= 0) && (num3 < width && num4 < length))
                         validCells = validCells | (uint)(1 << (num4 << 3) + num3);
                 }
             }
         }
     }
 }
开发者ID:boformer,项目名称:GrowableOverhaul,代码行数:48,代码来源:BuildingDetour.cs


示例20: add

 public void add(int a, string b, Texture2D c, string d)
 {
     ItemClass newItem = new ItemClass (a, b, c, d);
     for (int i=0; i<list.Length; i++) {
         if (list[i].getID() == -1)
         {
             list[i] = newItem;
             list[i].count++;
             break;
         }
         if (list[i].getID() == a){
             list[i].count++;
             break;
         }
     }
 }
开发者ID:Novascape,项目名称:novascape,代码行数:16,代码来源:InventoryGUI.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ItemClickEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# ItemArray类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap