Ejemplo n.º 1
0
        //获取实体,准备增删改
        private void GetAlias(ActType act)
        {
            string s1 = textBox1.Text.Trim(); var c = checkedListBox1.SelectedItem;
            string s2   = LineProcess();
            string type = c == null?AliasType.http.ToString() : c.ToString();

            ListViewItem p = new ListViewItem();

            p = ListItemIndex == -1 ? null : listView1.Items[ListItemIndex];  //鼠标点击时,已经得到行号
            switch (act)
            {
            case ActType.Add:
                _al = new Alias {
                    Name = s1, Path = s2, Type = type, AddTime = DateTime.Now
                };
                break;

            case ActType.Edit:
                _al = new Alias {
                    ID = int.Parse(p.SubItems[0].Text), Name = s1, Path = s2, Type = type, AddTime = DateTime.Now
                };
                break;

            case ActType.Del:
                _al = new Alias {
                    ID = int.Parse(p.SubItems[0].Text), Type = p.SubItems[3].Text
                };
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
 public void LoadOriginData()
 {
     //如果只有三个信息段,应为图片退出操作
     if (dataArr.Length == 3)
     {
         aniActType = ActType.Quit;
         for (int i = 0; i < headAniList.Count; i++)
         {
             GameObject animateObject = headAniList[i] as GameObject;
             if (animateObject.GetComponent <FaceAni>().NameId.Trim() == dataArr[1].Trim())
             {
                 aniObject = animateObject;
             }
         }
     }
     //有五个数据,是图片进入或者移动操作
     if (dataArr.Length == 5)
     {
         aniActType = ActType.Enter;
         foreach (GameObject aniobject in headAniList)
         {
             if (aniobject.GetComponent <FaceAni>().NameId.Trim() == dataArr[1].Trim())
             {
                 aniActType = ActType.Move;
                 aniObject  = aniobject;
             }
         }
         //得到数据
         name    = dataArr[1].Trim();
         actType = dataArr[2].Trim();
         aniName = dataArr[3].Trim();
         pos     = dataArr[4].Trim();
     }
 }
Ejemplo n.º 3
0
        public void PlayAct(ActType actType)
        {
            Act act = null;

            if (curAct != null && curAct.next != null)
            {
                foreach (var a in curAct.next)
                {
                    if (a.table.type == (int)actType)
                    {
                        act = a;
                        break;
                    }
                }
            }
            if (act == null)
            {
                foreach (var a in actCombos)
                {
                    if (a.table.type == (int)actType)
                    {
                        act = a;
                        break;
                    }
                }
            }
            Log.ErrorIf(act == null, $"Not Found Act {actType}");
            curAct = act;
            if (role.move.IsMoving)
            {
                role.move.StopMove();
            }
            Log.ErrorIf(act.anim == null, $"Not Found Act anim {act.table.anim},{act}");
            role.avatar.AnimCtrl.PlayAnimation(act.anim, null);
        }
Ejemplo n.º 4
0
        private void RandomAct()
        {
            int randomNum = random.Next(1000000);

            if (randomNum >= 0 && randomNum < 5000 && CurAct == ActType.Walk)
            {
                CurAct = ActType.Tail;
            }
            if (randomNum >= 5000 && randomNum < 7000 && CurAct == ActType.Tail)
            {
                CurAct = ActType.Walk;
            }
            if (randomNum >= 7000 && randomNum < 9000 && CurAct == ActType.Walk)
            {
                CurAct = ActType.WalkR;
            }
            if (randomNum >= 9000 && randomNum < 9500 && (CurAct == ActType.Walk || CurAct == ActType.Tail))
            {
                CurAct = ActType.Hit;
            }
            if (randomNum >= 9500 && randomNum < 9800 && (CurAct == ActType.Walk || CurAct == ActType.Tail))
            {
                CurAct = ActType.Eat;
            }
            if (randomNum >= 9800 && randomNum < 10000 && (CurAct == ActType.Walk || CurAct == ActType.Tail))
            {
                CurAct = ActType.Hungry;
            }
        }
Ejemplo n.º 5
0
        private void TimerMain_Tick(object sender, EventArgs e)
        {
            var curActBag = Animations.FirstOrDefault(x => x.ActType == CurAct);

            if (curActBag == null)
            {
                return;
            }

            if (CurAct == ActType.Walk || CurAct == ActType.WalkR)
            {
                FreeMove();
            }

            var curAnimation = curActBag.Animations.ElementAt(curFrame++);

            cat.SetBitmap(curAnimation);

            if (curFrame >= curActBag.FrameCount)
            {
                curFrame = 0;
                if (CurAct != ActType.Walk && CurAct != ActType.WalkR)
                {
                    curAct = ActType.Tail;
                }
            }

            if (cat.Enabled)
            {
                RandomAct();
            }
        }
Ejemplo n.º 6
0
        public static string GetFullActName(ActType actType)
        {
            switch (actType)
            {
            case ActType.АктОбследования: return("Акт обследования земельного участка");

            case ActType.АктПроверкиФизЛица: return("Акт проверки соблюдения земельного законодательства физическим лицом");

            case ActType.ПланПроверокГраждан: return("План проверок граждан");

            case ActType.АктПроверкиЮл: return("Акт проверки юридического лица, индивидуального предпринимателя");

            case ActType.ЖурналУчетаПроверокЮл: return("Журнал учета проверок юридического лица, индивидуального предпренимателя");

            case ActType.ЗаявлениеСоглВнеплВыездПроверки: return("Заявление о согласовании проведения внеплановой выездной проверки юридического лица, индивидуального предпринимателя");

            case ActType.ОбмерПлощадиЗу: return("Обмер площади земельного участка");

            case ActType.ПредписаниеУтсрНарушЗемЗакона: return("Предписание об устранении нарушения земельного законодательства");

            case ActType.ПротоколАдмПравонарушения: return("Протокол об административном правонарушении");

            case ActType.ФотоТаблица: return("Фототаблица");

            case ActType.аспоряжениеПроверкиЮл: return("Распоряжение о проведении проверки юридического лица, индивидуального предпринимателя");

            default: return("");
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,acttypeName,acttypeDescription")] ActType actType)
        {
            if (id != actType.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(actType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ActTypeExists(actType.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(actType));
        }
Ejemplo n.º 8
0
        public IGOEEntityAct PlayAct(string name, ActType mask = ActType.None, float speed = 1, bool immediatelyRun = false)
        {
            GOEEntityAct mMainAct;

            GOEEntityAct[] acts = this.GetComponents <GOEEntityAct>();
            if (!GOERoot.IsEditor || acts.Length == 0 || acts[0].Enable)
            {
                mMainAct = GOEEntityAct.GetActInstance(name);
                this.AddComponent(mMainAct);
            }
            else
            {
                mMainAct = acts[0];
            }
            mMainAct.TypeFilters    = mask;
            mMainAct.ActSpeed       = speed;
            mMainAct.ImmediatelyRun = immediatelyRun;
            if (mMainAct.ActName != name)
            {
                mMainAct.ActName = name;
                mMainAct.LoadAndPlay();
            }
            else
            {
                mMainAct.play();
            }
            return(mMainAct);
        }
Ejemplo n.º 9
0
 public void LoadOriginData()
 {
     //如果只有三个信息段,应为图片退出操作
     if (dataArr.Length == 3)
     {
         imgActType = ActType.Quit;
         for (int i = 0; i < headImageList.Count; i++)
         {
             GameObject imageObject = headImageList[i] as GameObject;
             if (imageObject.GetComponent <FaceImage>().nameId.Trim() == dataArr[1].Trim())
             {
                 imgObject = imageObject;
             }
         }
     }
     //有五个数据,是图片进入或者移动操作
     if (dataArr.Length == 5)
     {
         imgActType = ActType.Enter;
         foreach (GameObject imageObject in headImageList)
         {
             if (imageObject.GetComponent <FaceImage>().nameId.Trim() == dataArr[1].Trim())
             {
                 imgActType = ActType.Move;
                 imgObject  = imageObject;
             }
         }
         //得到数据
         name      = dataArr[1].Trim();
         actType   = dataArr[2].Trim();
         imageName = dataArr[3].Trim();
         pos       = dataArr[4].Trim();
     }
 }
Ejemplo n.º 10
0
 public Conv3DTranspose(int filters, Tuple <int, int, int> kernalSize, int strides = 1, PaddingType padding = PaddingType.Same, Tuple <int, int, int> dialationRate = null,
                        ActType activation = ActType.Linear, BaseInitializer kernalInitializer    = null,
                        BaseRegularizer kernalRegularizer = null, BaseConstraint kernalConstraint = null,
                        bool useBias = true, BaseInitializer biasInitializer = null, BaseRegularizer biasRegularizer = null, BaseConstraint biasConstraint = null)
     : base("conv3d_transpose")
 {
 }
Ejemplo n.º 11
0
        private void FreeMove()
        {
            cat.Top  += rateY;
            cat.Left += rateX;

            Rectangle rect         = SystemInformation.VirtualScreen;
            int       screenWidth  = rect.Width;
            int       screenHeight = rect.Height;

            if (cat.Left < rect.X && CurAct == ActType.Walk)
            {
                CurAct = ActType.WalkR;
            }
            if (cat.Left + cat.Width > screenWidth + rect.X && CurAct == ActType.WalkR)
            {
                CurAct = ActType.Walk;
            }
            if (cat.Top < 0 && rateY < 0)
            {
                rateY = -rateY;
            }
            if (cat.Top + cat.Height > screenHeight && rateY > 0)
            {
                rateY = -rateY;
            }
        }
Ejemplo n.º 12
0
    public void Add(ActType actType)
    {
        if (actComponet.ContainsKey(actType))
        {
            return;
        }
        ActComponent act = null;

        switch (actType)
        {
        case ActType.Null:
            break;

        case ActType.Anim:
            act = new AnimComponent(this);
            break;

        case ActType.Audio:
            act = new AudioComponent(this);
            break;

        case ActType.Effect:
            act = new EffectComponent(this);
            break;

        default:
            break;
        }

        if (act != null)
        {
            actComponet.Add(actType, act);
        }
    }
Ejemplo n.º 13
0
 /* Constructor to be used for creating logs */
 public ActivtyLog(ActType ActivityType, UserBase user, string ActivityDescription)
 {
     TimeStamp                = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmmssfff"));
     UserID                   = user.ID;
     this.ActivityType        = ActivityType;
     this.ActivityDescription = ActivityDescription;
 }
Ejemplo n.º 14
0
    void ActSet(ActType act)
    {
        act_cur = act;
        switch (act_cur)
        {
        case ActType.idle:
        {
            //animator.Play("walk");
        }
        break;

        case ActType.gravityJump:
        {
            act_time = Time.time + 2f;
            //animator.Play("jump1");
        }
        break;

        case ActType.death:
        {
            act_time = Time.time + 1.0f;
            //animator.Play("death");
        }
        break;

        default:
            break;
        }
    }
Ejemplo n.º 15
0
        public static void WindowActions(ActType windowsactions)
        {
            if (windowsactions == ActType.Maximize)
                PropertiesCollection.driver.Manage().Window.Maximize();

            if (windowsactions == ActType.Close)
                PropertiesCollection.driver.Close();

        }
        public async Task <IActionResult> Create([Bind("ID,acttypeName,acttypeDescription")] ActType actType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(actType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(actType));
        }
Ejemplo n.º 17
0
    public void OnNicoNicoToggleSwitched(bool p_Flag)
    {
        if (_ActType == ActType.NicoNicoDouge && !p_Flag)
        {
            _ActType = ActType.None;
        }

        if (_ActType != ActType.NicoNicoDouge && p_Flag)
        {
            _ActType = ActType.NicoNicoDouge;
        }
    }
Ejemplo n.º 18
0
        public void Attack()
        {
            var state = (uint)EActStatus.AttackBusy | (uint)EActStatus.YingZhi;

            if ((mStatus & state) != 0)
            {
                cacheAct     = ActType.Attack;
                cacheActTime = GameTime.time;
                return;
            }
            cacheAct = ActType.None;
            PlayAct(ActType.Attack);
        }
Ejemplo n.º 19
0
 private void setFilters()
 {
     if (TypeFilters != null)
     {
         for (int i = 0; i < ListComponent.Count; ++i)
         {
             ActType type = ActTypeNameAttribute.GetTypeFlag(ListComponent[i]);
             if ((TypeFilters & type) != ActType.None)
             {
                 ListComponent[i].IsIgored = true;
             }
         }
     }
 }
Ejemplo n.º 20
0
        public Activation(ActType type = ActType.Tanh) : base("Activation")
        {
            _type = type;
            String typeStr = null;

            switch (_type)
            {
            case ActType.Tanh:
            default:
                typeStr = "tanh";
                break;
            }
            this.SetParam("act_type", typeStr);
        }
Ejemplo n.º 21
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (ActType != 0)
            {
                hash ^= ActType.GetHashCode();
            }
            if (Pro != 0)
            {
                hash ^= Pro.GetHashCode();
            }
            if (Power != 0)
            {
                hash ^= Power.GetHashCode();
            }
            if (DepartmentLevel != 0)
            {
                hash ^= DepartmentLevel.GetHashCode();
            }
            if (Title.Length != 0)
            {
                hash ^= Title.GetHashCode();
            }
            if (NeedTime != 0)
            {
                hash ^= NeedTime.GetHashCode();
            }
            hash ^= Fans.GetHashCode();
            hash ^= Consume.GetHashCode();
            hash ^= awards_.GetHashCode();
            if (RandomeFansNum != 0)
            {
                hash ^= RandomeFansNum.GetHashCode();
            }
            if (Order != 0)
            {
                hash ^= Order.GetHashCode();
            }
            if (MovieId != 0)
            {
                hash ^= MovieId.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 22
0
 public Dense(int dim, ActType activation       = ActType.Linear,
              BaseInitializer kernalInitializer = null, BaseRegularizer kernalRegularizer = null, BaseConstraint kernalConstraint = null,
              bool useBias = true, BaseInitializer biasInitializer = null, BaseRegularizer biasRegularizer = null, BaseConstraint biasConstraint = null)
     : base("dense")
 {
     Dim               = dim;
     Act               = ActivationRegistry.Get(activation);
     UseBias           = useBias;
     KernalInitializer = kernalInitializer ?? new GlorotUniform();
     BiasInitializer   = biasInitializer ?? new Zeros();
     KernalConstraint  = kernalConstraint;
     BiasConstraint    = biasConstraint;
     KernalRegularizer = kernalRegularizer;
     BiasRegularizer   = biasRegularizer;
 }
Ejemplo n.º 23
0
 public override bool Execute()
 {
     //if type returned then add to menu typelist return false means "we dont need add type action any more"
     _type = TypeBox();
     if (_type != null)
     {
         planner.Menu.ActTypes.Add(_type);
         _type     = null;
         _typeName = "";
         return(false);//returns false becuase type added
     }
     else if (_type == null & _exitType == true)
     {
         _typeName = ""; _exitType = false; return(false);
     }                                                                                          //returns false becuase exit clicked
     return(true);
 }
Ejemplo n.º 24
0
 public Conv3D(int filters, Tuple <int, int, int> kernalSize, int strides = 1, PaddingType padding = PaddingType.Same, Tuple <int, int, int> dialationRate = null,
               ActType activation = ActType.Linear, BaseInitializer kernalInitializer = null, BaseRegularizer kernalRegularizer = null,
               BaseConstraint kernalConstraint = null, bool useBias = true, BaseInitializer biasInitializer = null, BaseRegularizer biasRegularizer = null, BaseConstraint biasConstraint = null)
     : base("conv3d")
 {
     Filters           = filters;
     KernalSize        = kernalSize;
     Strides           = strides;
     Padding           = padding;
     DialationRate     = dialationRate ?? Tuple.Create(1, 1, 1);
     Act               = activation;
     UseBias           = useBias;
     KernalInitializer = kernalInitializer ?? new GlorotUniform();
     BiasInitializer   = biasInitializer ?? new Zeros();
     KernalConstraint  = kernalConstraint;
     BiasConstraint    = biasConstraint;
     KernalRegularizer = kernalRegularizer;
     BiasRegularizer   = biasRegularizer;
 }
Ejemplo n.º 25
0
    protected object GetDisplay(object dataItem, string propertyName)
    {
        if (string.IsNullOrEmpty(CurUserId))
        {
            var userServ = ApplicationContext.Current.Services.Get <IUserService>();
            if (userServ != null)
            {
                CurUserId = userServ.UserId;
            }
        }
        var view = dataItem as ComponentView;

        if (view != null)
        {
            if (view.IsVirtualComponent)
            {
                object ActUserId;
                object ActType;
                object value;
                if (view.VirtualComponentProperties.TryGetValue("UserId", out ActUserId) &&
                    view.VirtualComponentProperties.TryGetValue("Type", out ActType))
                {
                    if (ActType.Equals(ActivityType.atPersonal) && ActUserId.ToString() != CurUserId)
                    {
                        return((propertyName == "Description" || propertyName == "Category")
                             ? GetActivityTypeName("Activity_Personal_Name", "Personal")
                             : string.Empty);
                    }

                    if (view.VirtualComponentProperties.TryGetValue(propertyName, out value))
                    {
                        return(value);
                    }
                }
            }
            else
            {
                return(DataBinder.Eval(dataItem, propertyName));
            }
        }
        return(string.Empty);
    }
Ejemplo n.º 26
0
        public Action(string nom, int rng, ActType actType, int dmg, int rng2, string tg, string effsnd, Color clr, int hexdmg = 0, int newsndclip = 0, bool dorepeats = false)
        {
            sndclip   = newsndclip;
            repeatsnd = dorepeats;
            menuName  = nom;
            range     = rng;
            hexdamage = hexdmg;
            if (rng2 <= 0)
            {
                range2 = rng;
            }
            else
            {
                range2 = rng2;
            }
            attacksound = effsnd;

            actioncolor = clr;
            type        = actType;
            damage      = dmg;
            tagspecific = tg;
        }
Ejemplo n.º 27
0
    // Update is called once per frame
    void Update()
    {
        //	leap see one hand only.
        Frame frame = leapController.Frame();

        if (frame.Hands.Count != 1)
        {
            return;
        }
        if (isAct)
        {
            return;
        }

        Hand hand = frame.Hands[0];

        if (hand.PalmPosition.z < -10)
        {
            //	if exist wall for forward, can't forward.
            if (CanForward())
            {
                nowAct = ActType.MoveForward;
                StartCoroutine("MoveAction");
            }
        }
        else if (hand.PalmPosition.x > 60)
        {
            nowAct = ActType.TurnRight;
            StartCoroutine("MoveAction");
        }
        else if (hand.PalmPosition.x < -60)
        {
            nowAct = ActType.TurnLeft;
            StartCoroutine("MoveAction");
        }
    }
Ejemplo n.º 28
0
    public string characterName; //will be useful to know which character attacks

    public ActInfo(DamagesInfo dmgInfo, ActType actType, string characterName)
    {
        damagesInfo.Add(dmgInfo);
        this.actType       = actType;
        this.characterName = characterName;
    }
Ejemplo n.º 29
0
 public ActInfo(List <DamagesInfo> dmgInfo, ActType actType, string characterName)
 {
     damagesInfo        = dmgInfo;
     this.actType       = actType;
     this.characterName = characterName;
 }
Ejemplo n.º 30
0
 public ActIndividual(ActType actType) : base(actType)
 {
 }