本文整理汇总了C#中Slot类的典型用法代码示例。如果您正苦于以下问题:C# Slot类的具体用法?C# Slot怎么用?C# Slot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Slot类属于命名空间,在下文中一共展示了Slot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Session
public Session(Slot slot, Room room, Speaker speaker, string title)
{
Slot = slot;
Room = room;
Speaker = speaker;
Title = title;
}
开发者ID:AntoineGa,项目名称:microstuff,代码行数:7,代码来源:Session.cs
示例17: SwapItems
/// <summary>
/// Swaps two items from one slot to another
/// </summary>
/// <param name="from">The slot that we are moving from</param>
/// <param name="to">The slot that we are moving to</param>
public static void SwapItems(Slot from, Slot to)
{
if (to != null && from != null)
{
bool calcStats = from.transform.parent == CharacterPanel.Instance.transform || to.transform.parent == CharacterPanel.Instance.transform;
if (CanSwap(from, to))
{
Stack<ItemScript> tmpTo = new Stack<ItemScript>(to.Items); //Stores the items from the to slot, so that we can do a swap
to.AddItems(from.Items); //Stores the items in the "from" slot in the "to" slot
if (tmpTo.Count == 0) //If "to" slot if 0 then we dont need to move anything to the "from " slot.
{
//FIX REMOVED SLOTS MINUSMINUS
from.ClearSlot(); //clears the from slot
}
else
{
from.AddItems(tmpTo); //If the "to" slot contains items thne we need to move the to the "from" slot
}
}
if (calcStats) //Calculates the stats if we need to
{
CharacterPanel.Instance.CalcStats();
}
}
}
开发者ID:ALapidis,项目名称:AmberIsles,代码行数:35,代码来源:Slot.cs
示例18: use
public override void use(Slot slot)
{
GameObject.FindObjectOfType<KeyHandler>().EquipSetActive(true);
if (slot.name.Equals("Slot") || slot.name.Equals("ResultSlot"))
{
Slot equipSlot = GameObject.Find(this.SubType.ToString()).GetComponent<Slot>();
BaseItem tmp = equipSlot.SlotItems();
equipSlot.ClearSlot();
equipSlot.AddItem(this);
slot.ClearSlot();
if (slot.name.Equals("Slot"))
{
slot.AddItem(tmp);
}
else
{
GameControl.inventory.AddItemToInventory(tmp);
GameControl.comboWindow.Created = false;
}
GameControl.player.Stats.TransferStats(this.Stats);
}
else
{
GameControl.inventory.AddItemToInventory(this);
GameControl.player.Stats.RemoveStats(this.Stats);
slot.ClearSlot();
}
}
开发者ID:RAWeber,项目名称:Unity,代码行数:28,代码来源:BaseEquipment.cs
示例19: GetDrop
public override bool GetDrop(ToolItem tool, out Slot[] drop)
{
drop = new Slot[0];
if (tool is ShovelItem)
drop = new[] { new Slot((ushort)new SnowballItem(), 1) };
return tool is ShovelItem;
}
开发者ID:Imperceptus,项目名称:Craft.Net,代码行数:7,代码来源:SnowfallBlock.cs
示例20: TryReadPacket
public override int TryReadPacket(byte[] buffer, int length)
{
int offset = 1;
double x, y, z;
ushort id, metadata;
byte count;
if (!DataUtility.TryReadInt32(buffer, ref offset, length, out EntityId))
return -1;
if (!DataUtility.TryReadUInt16(buffer, ref offset, length, out id))
return -1;
if (!DataUtility.TryReadByte(buffer, ref offset, length, out count))
return -1;
if (!DataUtility.TryReadUInt16(buffer, ref offset, length, out metadata))
return -1;
if (!DataUtility.TryReadAbsoluteInteger(buffer, ref offset, length, out x))
return -1;
if (!DataUtility.TryReadAbsoluteInteger(buffer, ref offset, length, out y))
return -1;
if (!DataUtility.TryReadAbsoluteInteger(buffer, ref offset, length, out z))
return -1;
if (!DataUtility.TryReadPackedByte(buffer, ref offset, length, out Rotation))
return -1;
if (!DataUtility.TryReadPackedByte(buffer, ref offset, length, out Pitch))
return -1;
if (!DataUtility.TryReadPackedByte(buffer, ref offset, length, out Yaw))
return -1;
Item = new Slot(id, count, metadata);
Position = new Vector3(x, y, z);
return offset;
}
开发者ID:ammaraskar,项目名称:SMProxy,代码行数:30,代码来源:SpawnDroppedItemPacket.cs
注:本文中的Slot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论