Ejemplo n.º 1
0
        public override void Use(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
        {
            if (!string.IsNullOrEmpty(Target))
            {
                for (BaseEntity target = null; (target = EntUtils.FindEntityByTargetName(target, Target)) != null;)
                {
                    if ((SpawnFlags & SF.MaskFX) == 0)
                    {
                        target.RenderEffect = RenderEffect;
                    }

                    if ((SpawnFlags & SF.MaskAmount) == 0)
                    {
                        target.RenderAmount = RenderAmount;
                    }

                    if ((SpawnFlags & SF.MaskMode) == 0)
                    {
                        target.RenderMode = RenderMode;
                    }

                    if ((SpawnFlags & SF.MaskColor) == 0)
                    {
                        target.RenderColor = RenderColor;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public override void Use(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
        {
            // Find the entity in our list
            //This fixes a bug where entities that trigger this that weren't listed could still count
            var entity = Entities.Find(e => e.Entity == pCaller);

            if (entity == null)
            {
                // if we didn't find it, report error and leave
                Log.Alert(AlertType.Console, $"MultiSrc:Used by non member {pCaller.ClassName}.\n");
                return;
            }

            // CONSIDER: a Use input to the multisource always toggles.  Could check useType for ON/OFF/TOGGLE

            entity.Triggered = !entity.Triggered;

            if (IsTriggered(pActivator))
            {
                Log.Alert(AlertType.AIConsole, $"Multisource {TargetName} enabled ({Entities.Count} inputs)\n");

                var targetUseType = UseType.Toggle;
                if (GlobalState != null)
                {
                    targetUseType = UseType.On;
                }

                //TODO: should not pass null
                SUB_UseTargets(null, targetUseType, 0);
            }
        }
Ejemplo n.º 3
0
 public DocumentAttribute(string name, UseType usage, string description, params string[] notes)
 {
     Name        = name;
     Usage       = usage;
     Description = description;
     Notes       = notes == null ? new List <string>() : notes.ToList();
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 自动绑定
        /// </summary>
        /// <param name="bh"></param>
        /// <returns></returns>
        public void AutoBindingInfo(UseType p_UseType)
        {
            IEnumerable <YTLBSummaryInfo> re = this.Cast <YTLBSummaryInfo>().Where(p => p.BDBH.Trim() == string.Empty && p.YTLB == p_UseType.ToString());

            foreach (YTLBSummaryInfo item in re)
            {
                YTLBSummaryInfo m_info = GetBDBHInfo(item.BH);
                if (m_info == null)
                {
                    IEnumerable <_ObjectQuantityUnitInfo> m_ObjectQuantityUnitInfo = this.Parent.Property.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.BH == item.BH);
                    if (m_ObjectQuantityUnitInfo.Count() > 0)
                    {
                        _ObjectQuantityUnitInfo m_defanyl = m_ObjectQuantityUnitInfo.FirstOrDefault();
                        item.BDBH = m_defanyl.BH;
                        item.SLH  = m_defanyl.SLH;
                        item.SCDJ = m_defanyl.SCDJ;
                        item.DEDJ = m_defanyl.DEDJ;
                        item.GGXH = m_defanyl.GGXH;
                        foreach (_ObjectQuantityUnitInfo items in m_ObjectQuantityUnitInfo)
                        {
                            items.STATUS = Status.Update;
                            items.YTLB   = item.YTLB;
                        }
                    }
                    this.Parent.Property.TemporaryCalculate.Calculate();
                }
            }
            this.Parent.Property.YTLBSummaryList_BindingSource.ResetBindings(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Used by SUB_UseTargets, when a platform is the target of a button
        /// Start bringing platform down
        /// </summary>
        /// <param name="pActivator"></param>
        /// <param name="pCaller"></param>
        /// <param name="useType"></param>
        /// <param name="value"></param>
        private void PlatUse(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
        {
            if (IsTogglePlat())
            {
                // Top is off, bottom is on
                var on = ToggleState == ToggleState.AtBottom;

                if (!ShouldToggle(useType, on))
                {
                    return;
                }

                if (ToggleState == ToggleState.AtTop)
                {
                    GoDown();
                }
                else if (ToggleState == ToggleState.AtBottom)
                {
                    GoUp();
                }
            }
            else
            {
                SetUse(null);

                if (ToggleState == ToggleState.AtTop)
                {
                    GoDown();
                }
            }
        }
Ejemplo n.º 6
0
        public override void Use(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
        {
            if ((SpawnFlags & SF.WaitRetrigger) != 0)
            {
                // Move toward my target
                SpawnFlags &= ~SF.WaitRetrigger;
                Next();
            }
            else
            {
                SpawnFlags |= SF.WaitRetrigger;
                // Pop back to last target if it's available
                if (Enemy != null)
                {
                    Target = Enemy.TargetName;
                }

                SetNextThink(0);
                Velocity = WorldConstants.g_vecZero;

                if (!string.IsNullOrEmpty(NoiseArrived))
                {
                    EmitSound(SoundChannel.Voice, NoiseArrived, Volume);
                }
            }
        }
Ejemplo n.º 7
0
        public override bool KeyValue(string key, string value)
        {
            if (key == "triggerstate")
            {
                int.TryParse(value, out var type);

                switch (type)
                {
                case 0:
                    TriggerType = UseType.Off;
                    break;

                case 2:
                    TriggerType = UseType.Toggle;
                    break;

                default:
                    TriggerType = UseType.On;
                    break;
                }
                return(true);
            }

            return(base.KeyValue(key, value));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="vType">1.通用 2.符号方案管理</param>
        public FrmSymbolManager(UseType vType)
        {
            //此调用是 Windows 窗体设计器所必需的
            InitializeComponent();

            //在 InitializeComponent() 调用之后添加任何初始化
            m_UseType = vType;
        }
Ejemplo n.º 9
0
 public override void Use(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
 {
     //Toggle texture
     if (ShouldToggle(useType, ((int)Frame) != 0))
     {
         Frame = 1 - Frame;
     }
 }
Ejemplo n.º 10
0
        // POST: /UseType/Delete/5

        public ActionResult Delete(int id)
        {
            UseType usetype = db.UseTypes.Find(id);

            db.UseTypes.Remove(usetype);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 11
0
 public void SetUseType(int tabIndex, UseType type)
 {
     if (tabIndex < m_CustomBarCellList.Count)
     {
         Setting_CustomBarCellData cell = m_CustomBarCellList[tabIndex];
         cell.UseType = (int)type;
         IsDrty       = true;
     }
 }
Ejemplo n.º 12
0
        public override void Use(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
        {
            SUB_UseTargets(this, TriggerType);

            if ((SpawnFlags & SF.FireOnce) != 0)
            {
                EntUtils.Remove(this);
            }
        }
Ejemplo n.º 13
0
 public ItemData(bool isActive, bool isInInven, string itemName, Type itemType, string interactWith, UseType useType, Vector3 position)
 {
     this.isActive     = isActive;
     this.isInInven    = isInInven;
     this.itemName     = itemName;
     this.itemType     = itemType;
     this.interactWith = interactWith;
     this.useType      = useType;
     this.position     = position;
 }
Ejemplo n.º 14
0
        public IActionResult Update(string oid, [FromBody] UseType useType)
        {
            var useTypeDb = _useTypeRepository.Find(x => x.Oid == new Guid(oid));

            useTypeDb.Name = useType.Name;
            _useTypeRepository.Update(useTypeDb);

            _unitOfWork.Complete();
            return(Ok(useTypeDb));
        }
Ejemplo n.º 15
0
 public ActionResult Edit([Bind(Include = "Id,TypeName")] UseType usetype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usetype).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(usetype));
 }
Ejemplo n.º 16
0
 public void AddFromSurface(UseType typeToAdd, int amountToAdd)
 {
     if (percentageFull < 100 && typeToAdd == canGetFromSurface)
     {
         if (visualElement)
         {
             visualElement.SetActive(percentageFull > 0);
         }
         percentageFull += amountToAdd;
     }
 }
Ejemplo n.º 17
0
 public Item(Item item)
 {
     this.id             = item.id;
     this.title          = item.title;
     this.description    = item.description;
     this.hasUse         = item.hasUse;
     this.maxStackAmount = item.maxStackAmount;
     this.useType        = item.useType;
     this.icon           = item.icon;
     this.stats          = item.stats;
 }
 public ScriptEdit(Window parent, IIndexItem <DefaultFileExtraInfo> index, UseType useType)
 {
     this.parent  = parent;
     this.index   = index;
     this.useType = useType;
     this.wrapper = DI.Wrapper;
     InitializeComponent();
     this.PopulateDataFields();
     this.ShowControls();
     this.SizeToContent = SizeToContent.WidthAndHeight;
 }
Ejemplo n.º 19
0
 public Item(int id, string title, string description, bool hasUse, int maxStackAmount, UseType useType, Dictionary <string, int> stats)
 {
     this.id             = id;
     this.title          = title;
     this.description    = description;
     this.hasUse         = hasUse;
     this.maxStackAmount = maxStackAmount;
     this.useType        = useType;
     this.icon           = Resources.Load <Sprite>("Items/" + title);
     this.stats          = stats;
 }
Ejemplo n.º 20
0
 public override int GetHashCode()
 {
     if (!string.IsNullOrWhiteSpace(UseName))
     {
         return(UseType.GetHashCode() + UseName.GetHashCode());
     }
     else
     {
         return(UseType.GetHashCode());
     }
 }
Ejemplo n.º 21
0
        public ActionResult Create([Bind(Include = "Id,TypeName")] UseType usetype)
        {
            if (ModelState.IsValid)
            {
                db.UseTypes.Add(usetype);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(usetype));
        }
 private BLECommandsEdit(Window parent, IIndexItem <BLECmdIndexExtraInfo> index, UseType useType, BLE_DataType dataType)
 {
     this.parent   = parent;
     this.index    = index;
     this.useType  = useType;
     this.dataType = dataType;
     InitializeComponent();
     this.Init();
     this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnOk);
     this.widthManager.PrepForChange();
     this.SizeToContent = SizeToContent.WidthAndHeight;
 }
Ejemplo n.º 23
0
 public void UseRight(UseType useType, int currentChainLink)
 {
     if (useType == UseType.shortAttack)
     {
         //Animator.SetBool("UseRight_short", false);
         EquipmetHolder.RightHand.UseShort(this);
     }
     else if (useType == UseType.longAttack)
     {
         EquipmetHolder.RightHand.UseLong(this);
     }
 }
Ejemplo n.º 24
0
        public static BlockVar CreateVar(XmlNode i_node, UseType useType)
        {
            BlockVar var = new BlockVar();
            Scope scope = Scope.Block;

            var.UseType = useType;
            var.VarType = i_node.Attributes[0].Value;

            foreach (XmlNode node in i_node.ChildNodes) {
                switch (node.Name) {
                    case "script_name":
                        var.Name = node.InnerText;
                        break;
                    case "variable_scope":
                        switch(node.InnerText) {
                            case "Block":
                                scope = Scope.Block;
                                break;
                            case "System":
                                scope = Scope.System;
                                break;
                            case "Simulation":
                                scope = Scope.Simulation;
                                break;
                        }
                        var.Scope = scope;
                        break;
                    case "auto_index":
                        var.AutoIndex = bool.Parse(node.InnerText);
                        break;
                    case "series_size":
                        var.SeriesSize = int.Parse(node.InnerText);
                        break;
                    case "default_value":
                        var.DefaultValue = node.InnerText;
                        break;
                    case "external":
                        var.External = bool.Parse(node.InnerText);
                        break;
                    case "plots":
                        var.Plots = bool.Parse(node.InnerText);
                        break;
                    case "plot_area":
                        var.Plotname = node.InnerText;
                        break;
                    default:
                        break;
                }
            }

            return var;
        }
Ejemplo n.º 25
0
        public void Update_Sql_QuantityData(string BH, UseType type, IDbTransaction p_tran)
        {
            using (OleDbCommand cmd = this.Conn.CreateCommand())
            {
                cmd.Transaction = p_tran as OleDbTransaction;
                //新增
                StringBuilder strSql = new StringBuilder();
                strSql.Append(string.Format("update 工料机表 set YTLB='{0}'where BH='{1}'", type, BH));

                cmd.CommandText = strSql.ToString();
                cmd.ExecuteNonQuery();
            }
        }
Ejemplo n.º 26
0
        public override void Use(BaseEntity pActivator, BaseEntity pCaller, UseType useType, float value)
        {
            ModelName = null;                           //invisible
            Solid     = Solid.Not;                      // intangible

            var vecSpot = Origin + new Vector(0, 0, 8); // trace starts here!

            Server.Game.Engine.Trace.Line(vecSpot, vecSpot + new Vector(0, 0, -40), TraceFlags.IgnoreMonsters, Edict(), out var tr);

            // Pull out of the wall a bit
            if (tr.Fraction != 1.0)
            {
                Origin = tr.EndPos + (tr.PlaneNormal * (Magnitude - 24) * 0.6);
            }

            // draw decal
            if ((SpawnFlags & SF.NoDecal) == 0)
            {
                if (EngineRandom.Float(0, 1) < 0.5f)
                {
                    EntUtils.DecalTrace(tr, Decal.Scorch1);
                }
                else
                {
                    EntUtils.DecalTrace(tr, Decal.Scorch2);
                }
            }

            // draw fireball
            TempEntity.Explosion(Origin, (short)Globals.g_sModelIndexFireball, (SpawnFlags & SF.NoFireball) == 0 ? SpriteScale : 0, 15);

            // do damage
            if ((SpawnFlags & SF.NoDamage) == 0)
            {
                RadiusDamage(this, this, Magnitude, EntityClass.None, DamageTypes.Blast);
            }

            SetThink(Smoke);
            SetNextThink(Engine.Globals.Time + 0.3f);

            // draw sparks
            if ((SpawnFlags & SF.NoSparks) == 0)
            {
                int sparkCount = EngineRandom.Long(0, 3);

                for (var i = 0; i < sparkCount; ++i)
                {
                    Create("spark_shower", Origin, tr.PlaneNormal);
                }
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 根据使用方法得到订单商品名称
        /// </summary>
        /// <param name="useType"></param>
        /// <returns></returns>
        protected string GenerateSubject(UseType useType)
        {
            switch (useType)
            {
            case UseType.Recharge:
                return("{0}");

            case UseType.Order:
                return("{0}");

            default:
                throw new ArgumentException("参数错误");
            }
        }
Ejemplo n.º 28
0
        // GET: /UseType/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UseType usetype = db.UseTypes.Find(id);

            if (usetype == null)
            {
                return(HttpNotFound());
            }
            return(View(usetype));
        }
Ejemplo n.º 29
0
        private void useType_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (useTypes.SelectedIndex)
            {
            case 0:
                useType = UseType.SeedOnly;
                break;

            case 1:
                useType = UseType.WebAddress;
                break;
            }

            RefreshForm();
        }
Ejemplo n.º 30
0
 public async Task <IActionResult> Put(int id, [FromBody] UseType entity)
 {
     try
     {
         if (id < 1 || !isValid(entity))
         {
             return(new BadRequestResult());                            // This returns HTTP 404
         }
         return(Ok(await agent.Update <UseType>(id, entity)));
     }
     catch (Exception ex)
     {
         return(await HandleExceptionAsync(ex));
     }
 }
Ejemplo n.º 31
0
 public async Task <IActionResult> Post([FromBody] UseType entity)
 {
     try
     {
         if (!isValid(entity))
         {
             return(new BadRequestResult());
         }
         return(Ok(await agent.Add <UseType>(entity)));
     }
     catch (Exception ex)
     {
         return(await HandleExceptionAsync(ex));
     }
 }
Ejemplo n.º 32
0
 public EntityTag(Actor parentActor, Component parentComponent)
 {
     ParentActor = parentActor;
     ParentComponent = parentComponent;
     useType = UseType.Grab;
 }
Ejemplo n.º 33
0
        private void useType_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (useTypes.SelectedIndex)
            {
                case 0:
                    useType = UseType.SeedOnly;
                    break;
                case 1:
                    useType = UseType.WebAddress;
                    break;
            }

            RefreshForm();
        }