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


C# Slot类代码示例

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


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

示例1: CheckAllOccurrencesDestinationSlots

        private bool CheckAllOccurrencesDestinationSlots(Occurrence currentOccurrence, Slot currentDestinationSlot, Occurrence editedOccurrence)
        {
            var currentApp = currentOccurrence.Appointment as Appointment;

            var offsetOfTheOccurrence = currentApp.Start - currentOccurrence.Start;
            var destSlotOfMasterApp = OffsetSlot(currentDestinationSlot, offsetOfTheOccurrence);

            var occurrences = currentApp.GetOccurrences(scheduleView.VisibleRange.Start, scheduleView.VisibleRange.End);

            destinationSlot = null;
            foreach (var occ in occurrences)
            {
                var occurrenceDestinationSlot = OffsetSlot(destSlotOfMasterApp, occ.Start - currentApp.Start);

                var appsInOccurrenceDestinationSlot = scheduleView.AppointmentsSource
                    .OfType<IAppointment>()
                    .Where((IAppointment a) => a != occ.Appointment)
                    .All((IAppointment a) => !ConflictChecking.AreOverlapping(a, occurrenceDestinationSlot, editedOccurrence));

                if (!appsInOccurrenceDestinationSlot)
                {
                    ShowErrorWindow();
                    return true;
                }
            }

            return false;
        }
开发者ID:NathanEWhitaker,项目名称:xaml-sdk,代码行数:28,代码来源:Example.xaml.cs

示例2: CLCreatePC

        public CLCreatePC(Stream stream)
        {
            // read size
            this.BodySize = ReadUInt32(stream);

            // read timestamp
            this.TimeStamp = ReadUInt32(stream);

            // read Name
            this.Name = ReadString(stream);

            // read Slot
            this.Slot = (Slot)stream.ReadByte();

            // read BitSet
            this.BitSet = (byte)stream.ReadByte();

            // read Colors
            this.ColorHair = ReadUInt16(stream);
            this.ColorSkin = ReadUInt16(stream);
            this.ColorShirt = ReadUInt16(stream);
            this.ColorShirt2 = ReadUInt16(stream);
            this.ColorJeans = ReadUInt16(stream);
            this.ColorJeans2 = ReadUInt16(stream);

            // read STR DEX & INT
            this.STR = ReadUInt16(stream);
            this.DEX = ReadUInt16(stream);
            this.INT = ReadUInt16(stream);

            // read PCType
            this.PCType = (PCType)stream.ReadByte();
        }
开发者ID:RudyJ,项目名称:ODK-DarkEmu,代码行数:33,代码来源:CLCreatePC.cs

示例3: Start

	// Use this for initialization
	void Start () {
		slot = GetComponent<Slot>();

		if (linesEnabled)
			createPaylines();

	}
开发者ID:jvifian,项目名称:slotMachine1,代码行数:8,代码来源:SlotLines.cs

示例4: OffsetSlot

 private static Slot OffsetSlot(Slot slot, TimeSpan offset)
 {
     var newSlot = new Slot(slot);
     newSlot.Start = slot.Start.Add(offset);
     newSlot.End = slot.End.Add(offset);
     return newSlot;
 }
开发者ID:NathanEWhitaker,项目名称:xaml-sdk,代码行数:7,代码来源:Example.xaml.cs

示例5: LoadTable

 //加载关卡表
 void LoadTable()
 {
     TextAsset binAsset = Resources.Load<TextAsset>("Data/Level01");
     string[] lineArray = binAsset.text.Split('\n');
     //读取行数设置
     int RowCount = int.Parse(lineArray[0]);
     Tables = new Slot[RowCount][];
     //初始化列表
     for (byte i = 0; i < RowCount; i++)
     {
         //偶数行=10,奇数行=9
         int columnCount = (i % 2 == 0 ? 10 : 9);
         Tables[i] = new Slot[columnCount];
         //读取配置信息,不足空槽补齐
         if (i + 1 < lineArray.Length)
         {
             string columnArray = lineArray[i + 1].Trim();
             for (byte j = 0; j < columnCount; j++)
                 Tables[i][j] = new Slot(SlotContain, i, j, columnArray[j]);
         }
         else
         {
             for (byte j = 0; j < columnCount; j++)
                 Tables[i][j] = new Slot(SlotContain, i, j);
         }
     }
 }
开发者ID:JingChen1988,项目名称:Bubble,代码行数:28,代码来源:SlotTable.cs

示例6: OpenServerView

 public void OpenServerView(Slot slot, ref Connection connection,
     string dbName, string dbOwner)
 {
     Views[(int)slot] = null;
     Views[(int)slot] = new ServerObjectView(ref connection, dbName, dbOwner);
     //Views[(int)slot].LoadObjects();
 }
开发者ID:BackupTheBerlios,项目名称:sqlscriptman-svn,代码行数:7,代码来源:Database.cs

示例7: BootstrapAllSlots

 void BootstrapAllSlots()
 {
     foreach (KeyValuePair<string, SlotType> p in SlotType.all) {
       var slot = new Slot(p.Key);
       player.Slots[p.Key] = slot;
     }
 }
开发者ID:britg,项目名称:ptq,代码行数:7,代码来源:PlayerGenerator.cs

示例8: OnEnable

	void OnEnable() { 

		slot = GetComponent<Slot>();


		Slot.OnSlotStateChangeTo += OnSlotStateChangeTo;	
		Slot.OnSlotStateChangeFrom += OnSlotStateChangeFrom;	

		Slot.OnSpinBegin += OnSpinBegin;
		Slot.OnSpinInsufficentCredits += OnSpinInsufficentCredits;
		Slot.OnSpinSnap += OnSpinSnap;
		Slot.OnSpinDone += OnSpinDone;
		Slot.OnSpinDoneNoWins += OnSpinDoneNoWins;
		Slot.OnReelLand += OnReelLand;

		Slot.OnLineWinComputed += OnLineWinComputed;
		Slot.OnLineWinDisplayed += OnLineWinDisplayed;
		Slot.OnAllWinsComputed	+= OnAllWinsComputed;
		Slot.OnScatterSymbolHit += OnScatterSymbolHit;
		Slot.OnAnticipationScatterBegin += OnAnticipationScatterBegin;

		Slot.OnScatterSymbolLanded += OnScatterSymbolLanded;
		Slot.OnWinDisplayedCycle += OnWinDisplayedCycle;
		Slot.OnLinkedSymbolLanded += OnLinkedSymbolLanded;

		Slot.OnBeginCreditWinCountOff += OnBeginCreditWinCountOff;
		Slot.OnCompletedCreditCountOff += OnCompletedCreditCountOff;

		Slot.OnSymbolReturningToPool += OnSymbolReturningToPool;
	}
开发者ID:serenitii,项目名称:jeisimple,代码行数:30,代码来源:BeachDaysCallbacks.cs

示例9: CreatMainSlot

 public static PlayerItem CreatMainSlot(Slot slot, int levelResult)
 {
     var totalPoints = GetPointsByLvl(levelResult)*GetSlotCoef(slot);
     float diff = Utils.RandomNormal(0.5f, 1f);
     //Debug.Log("iffff " + diff);
     bool isRare = diff > 0.95f;
     totalPoints *= diff;
     float contest = UnityEngine.Random.Range(0.60f, 1f);
     if (contest > 0.9f)
         contest = 1f;
     var pparams = new Dictionary<ParamType,float>();
     var primary = Connections.GetPrimaryParamType(slot);
     var primaryValue = totalPoints*contest;
     pparams.Add(primary,primaryValue);
     if (contest < 0.95f)
     {
         var secondary = Connections.GetSecondaryParamType(slot);
         var secondaryValue = totalPoints*(1f - contest);
         pparams.Add(secondary, secondaryValue);
     }
     PlayerItem item = new PlayerItem(pparams,slot,isRare, totalPoints);
     if (contest < 0.85f && (slot == Slot.magic_weapon || slot == Slot.physical_weapon))//.65f
     {
         var spec = ShopController.AllSpecialAbilities.RandomElement();
         item.specialAbilities = spec;
         Debug.Log("WITH SPEC::: " + item.specialAbilities);
     }
     return item;
 }
开发者ID:Kinderril,项目名称:Provinence2,代码行数:29,代码来源:HeroShopRandomItem.cs

示例10: InitSimulation

        protected override void InitSimulation(int seed, LevelInfo level, PlayerInfo[] players, Slot[] slots)
        {
            simulation = new SecureSimulation(extensionPaths);

            // Settings aufbauen
            Setup settings = new Setup();
            settings.Seed = seed;
            settings.Level = level.Type;
            settings.Player = new TypeInfo[AntMe.Level.MAX_SLOTS];
            settings.Colors = new PlayerColor[AntMe.Level.MAX_SLOTS];

            for (int i = 0; i < AntMe.Level.MAX_SLOTS; i++)
            {
                // Farben übertragen
                settings.Colors[i] = slots[i].ColorKey;

                // KIs einladen
                if (players[i] != null)
                {
                    settings.Player[i] = players[i].Type;
                }
            }

            simulation.Start(settings);
        }
开发者ID:FrankFlamme,项目名称:AntMeCore,代码行数:25,代码来源:SecureSimulationClient.cs

示例11: consumeItem

 //アイテム消費 個数を1へらす 残り1個のときは空にする
 void consumeItem(int inventoryIndex)
 {
     if (inventory [inventoryIndex].itemCount > 1)
         inventory [inventoryIndex].itemCount--;
     else
         inventory [inventoryIndex] = new Slot(inventoryIndex, SCREENSCALE);
 }
开发者ID:fordream,项目名称:Kemomi,代码行数:8,代码来源:InventoryManager.cs

示例12: SwapItems

    public static void SwapItems(Slot source, Slot destination)
    {
        ItemType movingType = source.CurrentItem.Item.Type;

        if (source != null && destination != null) {
            bool needToRecalculateStats = source.transform.parent == CharacterPanel.Instance.transform || destination.transform.parent == CharacterPanel.Instance.transform;

            if(destination.canContain == ItemType.GENERIC || movingType == destination.canContain) {
                Stack<ItemHolder> tempDestination = new Stack<ItemHolder>(destination.Items);

                destination.AddItems(source.Items);

                if(tempDestination.Count == 0) {
                    if (source.type == SlotType.CHARACTER && destination.type == SlotType.INVENTORY)
                        GameObject.Find("Inventory").GetComponent<Inventory>().EmptySlots--;
                    else if (source.type == SlotType.INVENTORY && destination.type == SlotType.CHARACTER)
                        GameObject.Find("Inventory").GetComponent<Inventory>().EmptySlots++;
                    source.ClearSlot();
                } else {
                    source.AddItems(tempDestination);
                }
            }

            if (needToRecalculateStats) {
                CharacterPanel.Instance.CalculateStats();
            }
        }
    }
开发者ID:ivanrenic,项目名称:inventory-system,代码行数:28,代码来源:Slot.cs

示例13: Use

 public override void Use(Slot slot, ItemHolder item)
 {
     if (slot.type == SlotType.INVENTORY)
         CharacterPanel.Instance.EquipItem(slot, item, Equip);
     else if (slot.type == SlotType.CHARACTER)
         CharacterPanel.Instance.UnequipItem(slot, item);
 }
开发者ID:ivanrenic,项目名称:inventory-system,代码行数:7,代码来源:Equipment.cs

示例14: ScoreBox

    public ScoreBox(Slot slot)
    {
        this.slot = slot;

        mathMode = new RXTweenable(0.0f,HandleMathModeChange);

        base.Init(slot.player);

        contentContainer.AddChild(_scoreLabel = new FLabel("Raleway",""));
        _scoreLabel.color = Color.black;

        _baseLabel = new FLabel("Raleway","123");
        _baseLabel.color = Color.black;

        _deltaLabel = new FLabel("Raleway","22");
        _deltaLabel.color = Color.black;

        _signIcon = new FSprite("Icons/Plus");
        _signIcon.color = Color.black;

        _equalsIcon = new FSprite("Icons/Equals");
        _equalsIcon.color = Color.black;

        _skullSprite = new FSprite("Icons/Skull");
        _skullSprite.color = Color.black;

        slot.player.SignalScoreChange += HandleScoreChange;

        ListenForUpdate(HandleUpdate);
        HandleMathModeChange();
        HandleScoreChange();
    }
开发者ID:MattRix,项目名称:ScorekeeperX,代码行数:32,代码来源:ScoreBox.cs

示例15: Use

	public override void Use (Slot slot, ItemScript item) {

        if (ItemName == "Energy Potion" && Stamina.Instance.currentStamina < Stamina.Instance.maxStamina){
            Debug.Log(ItemName);
            Stamina.Instance.currentStamina += Stamina.Instance.energyPot;
            Stamina.Instance.bar.fillAmount += Stamina.Instance.energyPot / 100f;
            Stamina.Instance.ManaColor();
            Stamina.Instance.ManaText();
                if(Stamina.Instance.currentStamina >= Stamina.Instance.maxStamina) {
                    Stamina.Instance.currentStamina = Stamina.Instance.maxStamina;
                }
            slot.RemoveItem();
        }
        if (ItemName == "Health Potion" && PlayerScript.Instance.currentHealth < PlayerScript.Instance.maxHealth) {
            Debug.Log(ItemName);
            PlayerScript.Instance.GetHealth();
            PlayerScript.Instance.HandleHealth();
            slot.RemoveItem();
        }
        if (ItemName == "Rage Potion" && Stamina.Instance.currentRage < Stamina.Instance.maxRage) {
            Debug.Log(ItemName);
            Stamina.Instance.RagePotion();
            slot.RemoveItem();
        }
    }
开发者ID:Fahrettin52,项目名称:Game-Lab-1.1,代码行数:25,代码来源:Consumable.cs


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