コード例 #1
0
 public void GetData()
 {
     data       = ActiveData.GetFromJSON(json);
     data.red   = data.RGB[0];
     data.green = data.RGB[1];
     data.blue  = data.RGB[2];
 }
コード例 #2
0
    void OnPlayerActive(ActiveData data)
    {
        _playersReady[data.PlayerIndex] = true;

        bool ready = true;

        for (int i = 0; i < _playersReady.Length; i++)
        {
            if (!_playersReady[i])
            {
                ready = false;
                break;
            }
        }

        if (ready)
        {
            _currentState          = GameState.PLAYING;
            cameraAudioSource.clip = loopingClips[1];
            cameraAudioSource.Play();

            for (int i = 0; i < _playersReady.Length; i++)
            {
                _playersReady[i] = false;
            }

            GameStart.Invoke();
        }
    }
コード例 #3
0
ファイル: BaseDbEasySearch.cs プロジェクト: madiantech/tkcore
        protected virtual IParamBuilder CreateAdditionCondition(TkDbContext context, IFieldInfoIndexer indexer)
        {
            TkDebug.AssertArgumentNull(context, "context", this);
            TkDebug.AssertArgumentNull(indexer, "indexer", this);

            ParamBuilderContainer result = new ParamBuilderContainer();

            if (FilterSql != null)
            {
                string sql = Expression.Execute(FilterSql, context, indexer);
                result.Add(sql);
            }
            if (DataRight != null)
            {
                TkDebug.ThrowIfNoGlobalVariable();
                IUserInfo     userInfo = BaseGlobalVariable.Current.UserInfo;
                IParamBuilder builder  = DataRight.GetListSql(new ListDataRightEventArgs(context, userInfo, indexer));
                result.Add(builder);
            }
            if (ActiveData != null)
            {
                IParamBuilder builder = ActiveData.CreateParamBuilder(context, indexer);
                result.Add(builder);
            }
            if (result.IsEmpty)
            {
                return(null);
            }
            return(result);
        }
コード例 #4
0
        public async Task <IActionResult> GetVisitorNumAsync()
        {
            var    response = ResponseModelFactory.CreateResultInstance;
            string url      = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxda982699a0604145&secret=a070591fca4a02e9502125d8b0a4d87a";

            ViewModels.Data.Token token = await Haikan3.Utils.ToHttp <ViewModels.Data.Token> .ToGet(url);

            List <ActiveData> datas = new List <ActiveData>();
            DateTime          date  = DateTime.Now;

            if (token != null && !string.IsNullOrEmpty(token.Access_token))
            {
                for (int i = date.Day - 1; i > 0; i--)
                {
                    string month = date.Month.ToString();
                    string day   = i.ToString();
                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (i < 10)
                    {
                        day = "0" + day;
                    }
                    string     time  = date.Year + month + day;
                    string     url2  = "https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token=" + token.Access_token;
                    string     pdata = "{\"begin_date\": \"" + time + "\",\"end_date\":\"" + time + "\"}";
                    ActiveData data  = await Haikan3.Utils.ToHttp <ActiveData> .ToPost(url2, pdata);

                    if (data != null && data.List != null && data.List.Count > 0)
                    {
                        datas.Add(data);
                    }
                    else
                    {
                        break;
                    }
                }
                int sum = 0;
                if (datas.Count == 0)
                {
                    sum = 0;
                }
                else
                {
                    sum = datas.Sum(x => x.List.Sum(y => y.Visit_uv));
                }

                response.SetSuccess();
                response.SetData(sum);
                return(Ok(response));
            }
            else
            {
                response.SetFailed("token为空");
                return(Ok(response));
            }
        }
コード例 #5
0
        public bool Add(ActiveData entity)
        {
            SqlCmdHelper cmd = new SqlCmdHelper()
            {
                SqlConnString = SqlConnString
            };

            return(cmd.ExcuteInsert(entity) > 0);
        }
コード例 #6
0
ファイル: RepoForOnSite.cs プロジェクト: SomSor/eexam2
        public void Active(DateTime ActiceDateTime, string centerid)
        {
            using (var db = new LiteDatabase(localdb))
            {
                ActiveData newActive = new ActiveData
                {
                    _id = Guid.NewGuid().ToString(),
                    ActiveFromDateTime = DateTime.Now,
                    ActiveThruDateTime = ActiceDateTime,
                };
                var col = db.GetCollection <ActiveData>("activedata");

                col.Insert(newActive);
            }
        }
コード例 #7
0
 public T GetQuantile <T>(double alpha, int columnIndex, bool considerSelection = false, T emptyValue = default(T)) where T : IComparable <T>
 {
     return(ActiveData.GetQuantile <T>(alpha, columnIndex, considerSelection, emptyValue));
 }
コード例 #8
0
 public T GetVariance <T>(int columnIndex, bool considerSelection = false, T emptyValue = default(T))
 {
     return(ActiveData.GetVariance <T>(columnIndex, considerSelection, emptyValue));
 }
コード例 #9
0
 public T GetStandardDeviation <T>(int columnIndex, bool considerSelection = false, T emptyValue = default(T))
 {
     return(ActiveData.GetStandardDeviation <T>(columnIndex, considerSelection, emptyValue));
 }
コード例 #10
0
 public T GetMode <T>(int columnIndex, bool considerSelection = false, T emptyValue = default(T)) where T : IEquatable <T>
 {
     return(ActiveData.GetMode <T>(columnIndex, considerSelection, emptyValue));
 }
コード例 #11
0
 public Type GetVariableType(int columnIndex)
 {
     return(ActiveData.GetVariableType(columnIndex));
 }
コード例 #12
0
 public int GetColumnIndex(string variableName)
 {
     return(ActiveData.GetColumnIndex(variableName));
 }
コード例 #13
0
 public IList <T> GetValues <T>(int columnIndex, bool considerSelection)
 {
     return(ActiveData.GetValues <T>(columnIndex, considerSelection));
 }
コード例 #14
0
 public int GetMissingValueCount(int columnIndex)
 {
     return(ActiveData.GetMissingValueCount(columnIndex));
 }
コード例 #15
0
 public bool Edit(ActiveData entity)
 {
     throw new NotImplementedException();
 }
コード例 #16
0
 public T GetCell <T>(int columnIndex, int rowIndex)
 {
     return(ActiveData.GetCell <T>(columnIndex, rowIndex));
 }
コード例 #17
0
 public int GetDistinctValues <T>(int columnIndex, bool considerSelection = false)
 {
     return(ActiveData.GetDistinctValues <T>(columnIndex, considerSelection));
 }
コード例 #18
0
 public int GetMissingValueCount()
 {
     return(ActiveData.GetMissingValueCount());
 }
コード例 #19
0
 public string GetCellAsString(int columnIndex, int rowIndex)
 {
     return(ActiveData.GetCellAsString(columnIndex, rowIndex));
 }
コード例 #20
0
 public int GetRowMissingValueCount(int rowIndex)
 {
     return(ActiveData.GetRowMissingValueCount(rowIndex));
 }
コード例 #21
0
 public string GetVariableName(int columnIndex)
 {
     return(ActiveData.GetVariableName(columnIndex));
 }