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

C# ModifierType类代码示例

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

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



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

示例1: AttributeModifier

 public AttributeModifier(string atributeAlias, float valueChange, ModifierType modifierType = ModifierType.Absolute, string name = null)
     : base(name)
 {
     this.AttributeAlias = atributeAlias;
     this.valueChange = valueChange;
     this.ChangeType = modifierType;
 }
开发者ID:LuciusSixPercent,项目名称:Finsternis,代码行数:7,代码来源:AttributeModifier.cs


示例2: OnMouseButtonPress

    public void OnMouseButtonPress(Vector MousePos, int button, ModifierType Modifiers)
    {
        if (Tilemap == null) return;

        UpdateMouseTilePos(MousePos);

        if (button == 1) {
            if ((selection.Width == 1) && (selection.Height == 1)) {
                application.TakeUndoSnapshot("Fill Tool");
                FloodFill(MouseTilePos, selection[0, 0]);
            }
            LastDrawPos = MouseTilePos;
            drawing = true;
            Redraw();
        }
        if(button == 3) {
            if(MouseTilePos.X < 0 || MouseTilePos.Y < 0
                || MouseTilePos.X >= Tilemap.Width
                || MouseTilePos.Y >= Tilemap.Height)
                return;

            SelectStartPos = MouseTilePos;
            selecting = true;
            UpdateSelection();
            Redraw();
        }
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:27,代码来源:FillEditor.cs


示例3: GetModifierValue

 private int GetModifierValue (ModifierTarget player, ModifierType modifierType)
 {
     ModifierTarget[] correctTargets = { player, ModifierTarget.All };
     return Modifiers.Where (
         i => correctTargets.Contains (i.Target) &&
         i.Modifier == modifierType).Sum (i => i.Value);
 }
开发者ID:lmlynik,项目名称:cardgame,代码行数:7,代码来源:SkirmishModifiers.cs


示例4: OnMouseButtonRelease

    public void OnMouseButtonRelease(Vector MousePos, int button, ModifierType Modifiers)
    {
        if (Tilemap == null) return;

        UpdateMouseTilePos(MousePos);

        if(button == 1) {
            drawing = false;
        }
        if(button == 3) {
            UpdateSelection();

            uint NewWidth = (uint) (SelectionP2.X - SelectionP1.X) + 1;
            uint NewHeight = (uint) (SelectionP2.Y - SelectionP1.Y) + 1;
            selection.Resize(NewWidth, NewHeight, 0);
            for(uint y = 0; y < NewHeight; y++) {
                for(uint x = 0; x < NewWidth; ++x) {
                    selection[x, y]
                        = Tilemap[(uint) SelectionP1.X + x,
                                  (uint) SelectionP1.Y + y];
                }
            }

            selection.FireChangedEvent();
            selecting = false;
        }

        Redraw();
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:29,代码来源:FillEditor.cs


示例5: AddAction

        public void AddAction(string playerA, string playerB, ActionType actionType, ModifierType modifyer, Weapon weapon, WhereType where, ArmyType teamA, ArmyType teamB)
        {
            Player playerGet = getPlayer(playerA, teamA);
            Player playerDo = null;
            
            //damage from the world (harrier, falling) will not be considered in this version
            if (playerB == string.Empty)
            {
                playerDo = playerGet;
            } else
            {
                playerDo = getPlayer(playerB, teamB);
            }

            switch (actionType)
            {
                case ActionType.Kill:
                    playerGet.AddAction(playerDo, ActionType.Die, modifyer, weapon, where);
                    playerDo.AddAction(playerGet, ActionType.Kill, modifyer, weapon, where);
                    break;
                case ActionType.Damage:
                    playerGet.AddAction(playerDo, ActionType.Damage, modifyer, weapon, where);
                    playerDo.AddAction(playerGet, ActionType.Damage, modifyer, weapon, where);
                    break;
            }
        }
开发者ID:gustavobello,项目名称:CarameloNoCocao-2.0,代码行数:26,代码来源:Game.cs


示例6: SnapValue

 /// <summary>
 /// Returns unit to snap to, based on passed Modifier keys and application settings
 /// </summary>
 protected int SnapValue(ModifierType Modifiers)
 {
     if ((Modifiers & ModifierType.ShiftMask) != 0) return 32;
     if ((Modifiers & ModifierType.ControlMask) != 0) return 16;
     if (application.SnapToGrid) return 32;
     return 0;
 }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:10,代码来源:ObjectToolBase.cs


示例7: Mod

 public Mod(StatType stat, ModifierType type, double value)
     : this()
 {
     Stat = stat;
     Type = type;
     Value = value;
 }
开发者ID:InferiorOlive,项目名称:AIQuest,代码行数:7,代码来源:StatModifierComponent.cs


示例8: KeyPress

 public bool KeyPress(Key key, char keyChar, ModifierType modifier)
 {
     int indentLength;
     char bulletChar;
     if(key == Key.Return)
     {
         var bulletState = GetBulletState(document.Editor.Caret.Line, out indentLength, out bulletChar);
         if(bulletState == BulletState.None)
         {
             return true;
         }
         if(bulletState == BulletState.InBullet)
         {
             // I'm not sure why the last space is eaten here
             var bulletLine = new string(' ', indentLength) + bulletChar + "  ";
             // + 1 since we put it at the next line
             document.Editor.Insert(document.Editor.Caret.Offset + 1, bulletLine);
             document.Editor.Caret.Offset += bulletLine.Length;
             document.Editor.Insert(document.Editor.Caret.Offset, document.Editor.EolMarker);
             document.Editor.Caret.Offset--;
             return false;
         }
         // time to finish the bullet
         var currentLine = document.Editor.GetLine(document.Editor.Caret.Line);
         document.Editor.Remove(currentLine.Offset, currentLine.Length);
         return true;
     }
     return true;
 }
开发者ID:konrad-kruczynski,项目名称:rstcompletion,代码行数:29,代码来源:Bullet.cs


示例9: Of

 public static StatModifier Of (ModifierType modifier, ModifierTarget target, int value)
 {
     return new StatModifier {
         Modifier = modifier,
         Target = target,
         Value = value
     };
 }
开发者ID:lmlynik,项目名称:cardgame,代码行数:8,代码来源:StatModifier.cs


示例10: ProcessKey

		public void ProcessKey (Key key, char ch, ModifierType modifiers)
		{
			var k = ch == '\0'? new ViKey (modifiers, key) : new ViKey (modifiers, ch);
			Keys.Add (k);
			if (!Builder (this)) {
				SetError ("Unknown command");
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:8,代码来源:ViBuilderContext.cs


示例11: Build

		public void Build (ViEditor editor, Key key, char ch, ModifierType modifiers)
		{
			var k = ch == '\0'? new ViKey (modifiers, key) : new ViKey (modifiers, ch);
			Keys.Add (k);
			if (!Builder (this)) {
				Error = "Unknown command";
			}
		}
开发者ID:sehe,项目名称:monodevelop,代码行数:8,代码来源:ViBuilderContext.cs


示例12: OnMouseButtonPress

    public void OnMouseButtonPress(Vector pos, int button, ModifierType Modifiers)
    {
        application.TakeUndoSnapshot( "Created Object '" + objectType + "'" );
        IGameObject gameObject = CreateObjectAt(pos);

        // switch back to object edit mode when shift was not pressed
        if((Modifiers & ModifierType.ShiftMask) == 0) {
            ObjectsEditor editor = new ObjectsEditor(application, application.CurrentSector);
            if(gameObject is IObject) {
                editor.MakeActive((IObject) gameObject);
            }
            application.SetEditor(editor);
        }
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:14,代码来源:ObjectCreationEditor.cs


示例13: DecomposeKeys

        /// <summary>
        /// Breaks apart an event key into the individual and normalized key and
        /// any modifiers.
        /// </summary>
        /// <param name="evt">The evt.</param>
        /// <param name="key">The key.</param>
        /// <param name="modifiers">The mod.</param>
        public static void DecomposeKeys(
			EventKey evt,
			out Key key,
			out ModifierType modifiers)
        {
            // Use the keymap to decompose various elements of the hardware keys.
            uint keyval;
            int effectiveGroup,
                level;
            ModifierType consumedModifiers;

            keymap.TranslateKeyboardState(
                evt.HardwareKeycode,
                evt.State,
                evt.Group,
                out keyval,
                out effectiveGroup,
                out level,
                out consumedModifiers);

            // Break out the identified keys and modifiers.
            key = (Key) keyval;
            modifiers = evt.State & ~consumedModifiers;

            // Normalize some of the keys that don't make sense.
            if (key == Key.ISO_Left_Tab)
            {
                key = Key.Tab;
                modifiers |= ModifierType.ShiftMask;
            }

            // Check to see if we are a character and pull out the shift key if
            // it is a capital letter. This is used to normalize so all the
            // keys are uppercase with a shift modifier.
            bool shiftWasConsumed = ((evt.State ^ modifiers) & ModifierType.ShiftMask)
                != 0;
            var unicode = (char) Keyval.ToUnicode((uint) key);

            if (shiftWasConsumed && Char.IsUpper(unicode))
            {
                modifiers |= ModifierType.ShiftMask;
            }

            if (Char.IsLetter(unicode)
                && Char.IsLower(unicode))
            {
                key = (Key) Char.ToUpper(unicode);
            }
        }
开发者ID:dmoonfire,项目名称:mfgames-gtkext-cil,代码行数:56,代码来源:GdkUtility.cs


示例14: KeyPress

		public override bool KeyPress (Key key, char keyChar, ModifierType modifier)
		{
			var result = base.KeyPress (key, keyChar, modifier);

			if (key == Key.Return) {
				if (textEditorData.Options.IndentStyle == IndentStyle.Virtual) {
					if (textEditorData.GetLine (textEditorData.Caret.Line).Length == 0)
						textEditorData.Caret.Column = textEditorData.IndentationTracker.GetVirtualIndentationColumn (textEditorData.Caret.Location);
				} else {
					DoReSmartIndent ();
				}
			}

			return result;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:JSonTextEditorExtension.cs


示例15: AddToStat

		/// <summary>
		/// Adds a given value to the existing value for a specific <see cref="ModifierType" /> in a
		/// specific <see cref="ModifierCategory">collection</see>. 
		/// </summary>
		/// <param name="collectionType">the collection type</param>
		/// <param name="statType">the stat type</param>
		/// <param name="value">the amount to add</param>
		public void AddToStat(ModifierCategory collectionType, ModifierType statType, double value)
		{
			m_changeLock.EnterWriteLock();

			try
			{
				m_modifiers[collectionType][statType] += value;

				if (!IsChangeFlagged(statType))
				{
					m_changes.AddLast(statType);
				}
			}
			finally
			{
				m_changeLock.ExitWriteLock();
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:25,代码来源:ModifierCollection.cs


示例16: OnScrolled

		protected override void OnScrolled (ScrollDirection direction, ModifierType mod)
		{
			if ((mod & ModifierType.ShiftMask) != ModifierType.ShiftMask)
				return;
			
			int shift = HueShift;
			
			if (direction == Gdk.ScrollDirection.Up)
				shift += 5;
			else if (direction == Gdk.ScrollDirection.Down)
				shift -= 5;
			
			if (shift < 0)
				shift += 360;
			shift %= 360;
			
			HueShift = shift;
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:18,代码来源:ColoredIconDockItem.cs


示例17: OnMouseButtonPress

    public void OnMouseButtonPress(Vector mousePos, int button, ModifierType Modifiers)
    {
        if (button == 1){
            IGameObject gameObject = CreateObjectAt(MousePos);

            // switch back to object edit mode when shift was not pressed
            if((Modifiers & ModifierType.ShiftMask) == 0) {
                ObjectSelectTool editor = new ObjectSelectTool(application, application.CurrentSector);
                if(gameObject is IObject) {
                    editor.MakeActive((IObject) gameObject);
                }
                application.SetTool(editor);
            }
        } else {	//cancel creation by other buttons
            application.SetToolObjects();
        }
        if (UpdateMousePos(mousePos))
            Redraw();
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:19,代码来源:ObjectCreationTool.cs


示例18: SetSecondaryWeaponModifier

    void SetSecondaryWeaponModifier(ModifierType modifierType)
    {
        if ( modifierType == ModifierType.None)
            return;

        if ( modifierType < ModifierType.NUM_ELEMENTAL_MODIFIERS ) { // ElementalModifier
            // update the elemental modifier
            switch(modifierType) {
                case ModifierType.Poison : modifierCombo.setElemental("PoisonModifier"); modifierDisplay.setEMod("Poison"); break;
                case ModifierType.EMP : modifierCombo.setElemental("EMPModifier"); modifierDisplay.setEMod("EMP"); break;
                case ModifierType.Explosion : modifierCombo.setElemental("ExplosionModifier"); modifierDisplay.setEMod("Explosion"); break;
                }
            }
        else { // BehavioralModifier
            // update the behavioral modifier
            switch(modifierType) {
                case ModifierType.HeatSeek : modifierCombo.setBehavioral("HeatSeekModifier"); modifierDisplay.setBMod("HeatSeek"); break;
                case ModifierType.Spread : modifierCombo.setBehavioral("SpreadModifier"); modifierDisplay.setBMod("Spread"); break;
                case ModifierType.Rebound : modifierCombo.setBehavioral("RebounderModifier"); modifierDisplay.setBMod("Rebound"); break;
            }
        }
        GetComponent<SecondaryFiring> ().SetEnergyCost (modifierCombo);
    }
开发者ID:Zeropointstudios,项目名称:Hybrid_Skies,代码行数:23,代码来源:PlayerController.cs


示例19: OnMouseMotion

 public new void OnMouseMotion(Vector mousePos, ModifierType Modifiers)
 {
     if (UpdateMouseTilePos(mousePos)) {
         if (state == State.DRAWING) {
             if (LastDrawPos != MouseTilePos) {
                 LastDrawPos = MouseTilePos;
                 brush.ApplyToTilemap(MouseTilePos, application.CurrentTilemap);
             }
         }
         if (state == State.FILLING || state == State.SELECTING) {
             UpdateSelection();
         }
         FireRedraw();
     }
 }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:15,代码来源:TileBrushTool.cs


示例20: IsChangeFlagged

 /// <summary>
 /// Checks if a change is flagged in the collection.
 /// </summary>
 /// <param name="statType">the stat type</param>
 /// <returns>true if the stat type is flagged; false otherwise</returns>
 private bool IsChangeFlagged(ModifierType statType)
 {
     return m_changes.Where(statChange => statChange == statType).Any();
 }
开发者ID:KroneckerX,项目名称:WCell,代码行数:9,代码来源:ModifierCollection.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Modifiers类代码示例发布时间:2022-05-24
下一篇:
C# ModifierList类代码示例发布时间: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