public void GetData() { data = ActiveData.GetFromJSON(json); data.red = data.RGB[0]; data.green = data.RGB[1]; data.blue = data.RGB[2]; }
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(); } }
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); }
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)); } }
public bool Add(ActiveData entity) { SqlCmdHelper cmd = new SqlCmdHelper() { SqlConnString = SqlConnString }; return(cmd.ExcuteInsert(entity) > 0); }
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); } }
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)); }
public T GetVariance <T>(int columnIndex, bool considerSelection = false, T emptyValue = default(T)) { return(ActiveData.GetVariance <T>(columnIndex, considerSelection, emptyValue)); }
public T GetStandardDeviation <T>(int columnIndex, bool considerSelection = false, T emptyValue = default(T)) { return(ActiveData.GetStandardDeviation <T>(columnIndex, considerSelection, emptyValue)); }
public T GetMode <T>(int columnIndex, bool considerSelection = false, T emptyValue = default(T)) where T : IEquatable <T> { return(ActiveData.GetMode <T>(columnIndex, considerSelection, emptyValue)); }
public Type GetVariableType(int columnIndex) { return(ActiveData.GetVariableType(columnIndex)); }
public int GetColumnIndex(string variableName) { return(ActiveData.GetColumnIndex(variableName)); }
public IList <T> GetValues <T>(int columnIndex, bool considerSelection) { return(ActiveData.GetValues <T>(columnIndex, considerSelection)); }
public int GetMissingValueCount(int columnIndex) { return(ActiveData.GetMissingValueCount(columnIndex)); }
public bool Edit(ActiveData entity) { throw new NotImplementedException(); }
public T GetCell <T>(int columnIndex, int rowIndex) { return(ActiveData.GetCell <T>(columnIndex, rowIndex)); }
public int GetDistinctValues <T>(int columnIndex, bool considerSelection = false) { return(ActiveData.GetDistinctValues <T>(columnIndex, considerSelection)); }
public int GetMissingValueCount() { return(ActiveData.GetMissingValueCount()); }
public string GetCellAsString(int columnIndex, int rowIndex) { return(ActiveData.GetCellAsString(columnIndex, rowIndex)); }
public int GetRowMissingValueCount(int rowIndex) { return(ActiveData.GetRowMissingValueCount(rowIndex)); }
public string GetVariableName(int columnIndex) { return(ActiveData.GetVariableName(columnIndex)); }