Word(int byteCount, Signs sign) { ByteCount = byteCount; mSign = sign; mBytes = new MixByte[byteCount]; mAccessLock = new ReaderWriterLock(); }
public World() { NPCs.Clear(); Signs.Clear(); Chests.Clear(); CharacterNames.Clear(); }
public char[] GetSignsOfType(SignTypes signTypes) { switch (signTypes) { case SignTypes.SmallLetters: return(Signs.SmallLetters()); case SignTypes.CapitalLetters: return(Signs.CapitalLetters()); case SignTypes.SmallPolishLetters: return(Signs.SmallPolishLetters()); case SignTypes.CapitalPolishLetters: return(Signs.CapitalPolishLetters()); case SignTypes.SpecialSigns: return(Signs.SpecialSigns()); case SignTypes.Digits: return(Signs.Digits()); default: return(null); } }
public Word(MixByte[] bytes, Signs sign) : this(bytes.Length, sign) { for (int i = 0; i < ByteCount; i++) { mBytes[i] = bytes[i]; } }
private void ValSpecial(int x, int y) { Tile curTile = Tiles[x, y]; //validate chest entry exists if (Tile.IsChest(curTile.Type)) { if (IsAnchor(x, y) && GetChestAtTile(x, y, true) == null) { Chests.Add(new Chest(x, y)); } } //validate sign entry exists else if (Tile.IsSign(curTile.Type)) { if (IsAnchor(x, y) && GetSignAtTile(x, y, true) == null) { Signs.Add(new Sign(x, y, string.Empty)); } } //validate TileEntity else if (Tile.IsTileEntity(curTile.Type)) { if (IsAnchor(x, y) && GetTileEntityAtTile(x, y, true) == null) { var TE = TileEntity.CreateForTile(curTile, x, y, TileEntities.Count); TileEntities.Add(TE); } } }
private void MultiplayerSpawnEnemy(int id, EnemyBehavior behavior) { if (behavior == null) { return; } Transform enemyTransform = behavior.transform; Rigidbody2D rigidbody = behavior.GetComponent <Rigidbody2D>(); using (RTData data = RTData.Get()) { Vector2 pos = enemyTransform.position; Signs posSign = SignsExt.GetSign(pos); Vector2 vel = rigidbody.velocity; Signs velSign = SignsExt.GetSign(vel); data.SetInt(1, id); data.SetVector2(3, pos); data.SetInt(4, (int)posSign); data.SetFloat(5, enemyTransform.rotation.eulerAngles.z); data.SetVector2(6, vel); data.SetInt(7, (int)velSign); gameSparksManager.RTSession.SendData( MultiplayerCodes.ENEMY_SPAWN.Int(), GameSparksRT.DeliveryIntent.RELIABLE, data ); } }
public override void InitSigns() { //寻找的词性 Signs.Add("ns"); Signs.Add("nsf"); ////后面禁止出现的词性 //NextBanSigns.Add("p"); ////后面允许出现的词性 //NextContinueSigns.Add("n"); //NextContinueSigns.Add("ns"); ////NextContinueSigns.Add("p"); ////前面允许出现的词性 //FrontAllowSigns.Add("p"); //FrontAllowSigns.Add("w"); //FrontAllowSigns.Add("ns"); //FrontAllowSigns.Add("nsf"); //FrontAllowSigns.Add("no-type"); //FrontAllowSigns.Add("b"); //FrontAllowSigns.Add("uj"); //FrontAllowSigns.Add("v"); //FrontAllowSigns.Add("f"); }
private void UpdatePlayers(RTPacket packet) { CheckPeers(packet, (index) => { Transform playerTransform = m_players[index].transform; Rigidbody2D playerRigidBody = m_players[index].GetComponent <Rigidbody2D>(); Quaternion playerRot = playerTransform.rotation; Vector3 playerAngles = playerRot.eulerAngles; // Referenced from PlayerController.SendTransformUpdates() Vector3 newPos = packet.Data.GetVector3(1).Value; Signs sign = (Signs)packet.Data.GetInt(2); newPos = SignsExt.Vector3Sign(newPos, sign); float newRot = packet.Data.GetFloat(3).Value; Vector2 newVel = packet.Data.GetVector2(4).Value; newVel = SignsExt.Vector2Sign(newVel, (Signs)packet.Data.GetInt(5)); playerTransform.position = newPos; playerRigidBody.velocity = newVel; playerAngles.z = newRot; playerRot.eulerAngles = playerAngles; playerTransform.rotation = playerRot; }); }
public void Validate() { for (int x = 0; x < TilesWide; x++) { OnProgressChanged(this, new ProgressChangedEventArgs((int)(x / (float)TilesWide * 100.0), "Validating World...")); for (int y = 0; y < TilesHigh; y++) { var curTile = Tiles[x, y]; if (curTile.Type == 127) { curTile.IsActive = false; } // TODO: Let Validate handle these //validate chest entry exists if (curTile.Type == 21) { if (GetChestAtTile(x, y) == null) { Chests.Add(new Chest(x, y)); } } //validate sign entry exists else if (curTile.Type == 55 || curTile.Type == 85) { if (GetSignAtTile(x, y) == null) { Signs.Add(new Sign(x, y, string.Empty)); } } } } }
public void SetSigns(List <string> signs) {// знаки AEElem add = new AEElem("+", "?L + ?R", "?L + ?R", default); AEElem sub = new AEElem("-", "?L - ?R", "?L - ?R", default); AEElem mul = new AEElem("*", "?L * ?R", "?L * ?R", default); AEElem div = Frac;//new AEElem("/", "?L / (?R)", "\\frac{?L}{?R}", "(fabs((?R)) > 1.0e-6)"); AEElem pow = new AEElem("^", "pow(?L, ?R)", "(?L)^{?R}", default); if (signs.Contains("+")) { Signs.Add(add); } if (signs.Contains("-")) { Signs.Add(sub); } if (signs.Contains("*")) { Signs.Add(mul); } if (signs.Contains("/")) { Signs.Add(div); } if (signs.Contains("^")) { Signs.Add(pow); } }
public Number(Signs sign, double value, bool signAtEnd = false) { Sign = sign; Variable = ""; Value = value; SignAtEnd = signAtEnd; }
IEnumerator SendTransformUpdates() { // To be safe if (!_transform) { _transform = transform; } if (!_rigidbody) { _rigidbody = GetComponent <Rigidbody2D>(); } while (true) { using (RTData data = RTData.Get()) { Vector3 pos = _transform.position; Vector2 vel = _rigidbody.velocity; data.SetVector3(1, pos); Signs posSign = SignsExt.GetSign(pos); data.SetInt(2, (int)posSign); data.SetFloat(3, _transform.eulerAngles.z); data.SetVector2(4, vel); data.SetInt(5, (int)SignsExt.GetSign(vel)); _gameSparksManager.RTSession.SendData( MultiplayerCodes.PLAYER_POSITION.Int(), GameSparksRT.DeliveryIntent.UNRELIABLE_SEQUENCED, data ); } yield return(new WaitForSeconds(UpdateRate)); } }
protected void Validate(IRuleSerializerRoot ruleSerializer) { if (Typicon == null || TypiconId == 0) { AddError("Версия Устава должна иметь ссылку на Устав"); } //Signs ValidateChildCollection(Signs.Cast <RuleEntity>(), ruleSerializer, ErrorConstants.Sign, ErrorConstants.Signs, "Должен быть определен хотя бы один Знак службы"); //CommonRules ValidateChildCollection(CommonRules.Cast <RuleEntity>(), ruleSerializer, ErrorConstants.CommonRule); //MenologyRules ValidateMenologyRules(ruleSerializer); //TriodionRules ValidateChildCollection(TriodionRules.Cast <RuleEntity>(), ruleSerializer, ErrorConstants.TriodionRule); //ExplicitAddRules ValidateChildCollection(ExplicitAddRules.Cast <RuleEntity>(), ruleSerializer, ErrorConstants.ExplicitAddRule); //Kathismas ValidateKathismas(ruleSerializer.TypiconSerializer); if (ScheduleSettings == null) { AddError("Версия Устава должна иметь Настройки дней богослужений"); } }
public override void InitSigns() { ////添加寻找的词性 Signs.Add("n"); //Signs.Add("j"); ////后面不允许存在的词性 //NextBanSigns.Add("d"); //NextBanSigns.Add("v"); //NextBanSigns.Add("w"); //NextBanSigns.Add("uj"); //NextBanSigns.Add("ad"); //NextBanSigns.Add("m"); //NextBanSigns.Add("f"); //NextBanSigns.Add("c"); //NextBanSigns.Add("w"); ////前面允许出现的词性 //FrontAllowSigns.Add("v"); //FrontAllowSigns.Add("j"); ////FrontAllowSigns.Add("ng"); //FrontAllowSigns.Add("no-type"); ////后面允许的词性 //NextContinueSigns.Add("n"); //NextContinueSigns.Add("j"); //NextContinueSigns.Add("vn"); }
private Signs reverseSign(Signs sign) { if (sign == Signs.Negative) { return(Signs.Positive); } return(Signs.Negative); }
public void ClearWorld() { _tiles = new Tile[Header.WorldBounds.W, Header.WorldBounds.H]; Chests.Clear(); Signs.Clear(); Npcs.Clear(); }
public Signs RandomSigns() { Signs sign = (Signs)UnityEngine.Random.Range(0, 2); Hand_Signs(sign); return(sign); }
public World() { NPCs.Clear(); Signs.Clear(); Chests.Clear(); CharacterNames.Clear(); TileFrameImportant = SettingsTileFrameImportant.ToArray(); // clone for "new" world. Loaded worlds will replace this with file data }
public Response GetBySign(Signs sign) { var request = new RestRequest("getHoroscopeBySignTTY"); request.AddOrUpdateParameter("sign_id", (int)sign); request.AddOrUpdateParameter("content_language", CultureInfo.InstalledUICulture.TwoLetterISOLanguageName); return(JsonConvert.DeserializeObject <Response>(this._http.Get(request).Content)); }
public bool HasSign(string item) { if (Signs.Contains(item)) { return(true); } return(false); }
public static Vector2 Vector2Sign(Vector2 vector, Signs sign) { int signInt = (int)sign; vector.x = Math.Abs(vector.x); vector.y = Math.Abs(vector.y); vector.x *= ((signInt & (int)Signs.X_NEG) == 0) ? 1 : -1; vector.y *= ((signInt & (int)Signs.Y_NEG) == 0) ? 1 : -1; return(vector); }
/// <summary> /// 从一个MySqlDataReader里读数据 /// </summary> /// <param name="Reader">MySqlDataReader</param> /// <returns>SignsExample</returns> public static Signs GetByReader(MySqlDataReader Reader) { Signs SignsExample = new Signs(); SignsExample.Id = Reader["Id"] == DBNull.Value ? 0 : (int)Reader["Id"]; SignsExample.SignTime = Reader["SignTime"] == DBNull.Value ? new DateTime() : Convert.ToDateTime(Reader["SignTime"]); SignsExample.Remark = Reader["Remark"] == DBNull.Value ? null : Reader["Remark"].ToString(); SignsExample.UId = Reader["UId"] == DBNull.Value ? 0 : (int)Reader["UId"]; SignsExample.UName = Reader["UName"] == DBNull.Value ? null : Reader["UName"].ToString(); SignsExample.UState = Reader["UState"] == DBNull.Value ? null : Reader["UState"].ToString(); SignsExample.UType = Reader["UType"] == DBNull.Value ? null : Reader["UType"].ToString(); return(SignsExample); }
public static long BytesToLong(Signs sign, params MixByte[] bytes) { long longValue = 0L; for (int i = 0; i < bytes.Length; i++) { longValue = (longValue << MixByte.BitCount) + bytes[i]; } longValue = sign.ApplyTo(longValue); return(longValue); }
private void Button_Click(object sender, RoutedEventArgs e) { record = !record; if (!record) { count++; Thread.Sleep(100); //kinectSensor.Close(); System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(Signs)); using (FileStream fs = new FileStream(@".\" + sign.Text + count + ".xml", FileMode.Create)) { writer.Serialize(fs, signs); } string time = System.DateTime.Now.ToString("hh'-'mm'-'ss", CultureInfo.CurrentUICulture.DateTimeFormat); System.IO.Directory.CreateDirectory(@".\" + sign.Text + count); //var frames = 0; var text = sign.Text; // write the new file to disk // FileStream is IDisposable var completed = Parallel.For(0, encoderframes.Count, frame => { BitmapEncoder encoder = new JpegBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(encoderframes[frame])); string path = Path.Combine(@".\" + text, frame + ".png"); using (FileStream fs = new FileStream(path, FileMode.Create)) { // Monitor.Enter(text); encoder.Save(fs); // Monitor.Exit(text); } }); } encoderframes = new List <BitmapSource>(); signs = new Signs(); signs.Sign.Name = sign.Text; if (!kinectSensor.IsOpen) { kinectSensor.Open(); } GC.Collect(); GC.WaitForPendingFinalizers(); //frames = 0; recordb.Content = !record ? "Record " + (count + 1): "stop recording"; }
public void ValSpecial(int x, int y) { Tile curTile = Tiles[x, y]; //validate chest entry exists if (Tile.IsChest(curTile.Type)) { if (GetChestAtTile(x, y) == null) { Chests.Add(new Chest(x, y)); } } //validate sign entry exists else if (Tile.IsSign(curTile.Type)) { if (GetSignAtTile(x, y) == null) { Signs.Add(new Sign(x, y, string.Empty)); } } //validate TileEntity else if (Tile.IsTileEntity(curTile.Type)) { if (GetTileEntityAtTile(x, y) == null) { TileEntity TE = new TileEntity(); TE.PosX = (short)x; TE.PosY = (short)y; TE.Id = TileEntities.Count; if (curTile.Type == (int)TileType.Dummy) { TE.Type = 0; TE.Npc = -1; } else if (curTile.Type == (int)TileType.ItemFrame) { TE.Type = 1; TE.NetId = 0; TE.Prefix = 0; TE.StackSize = 0; } else { TE.Type = 2; TE.On = false; TE.LogicCheck = (byte)(curTile.V / 18 + 1); } TileEntities.Add(TE); } } }
public static Vector4 Vector4Sign(Vector4 vector, Signs sign) { int signInt = (int)sign; vector.x = Math.Abs(vector.x); vector.y = Math.Abs(vector.y); vector.z = Math.Abs(vector.z); vector.w = Math.Abs(vector.w); vector.x *= ((signInt & (int)Signs.X_NEG) == 0) ? 1 : -1; vector.y *= ((signInt & (int)Signs.Y_NEG) == 0) ? 1 : -1; vector.z *= ((signInt & (int)Signs.Z_NEG) == 0) ? 1 : -1; vector.w *= ((signInt & (int)Signs.W_NEG) == 0) ? 1 : -1; return(vector); }
/// <summary> /// 查询全部数据 /// </summary> /// <returns>IList</returns> /*查看是否为视图*/ public IList <Signs> SearchAll() { DBHelper.sqlstr = "select * from Signs "; List <Signs> list = new List <Signs>(); MySqlDataReader reader = DBHelper.ExecuteReader(); while (reader.Read()) { Signs Obj = GetByReader(reader); list.Add(Obj); } reader.Close(); return(list); }
/// <summary> /// 根据Id,查询一条数据 /// </summary> /// <param name="Id"></param> /// <returns></returns> /*查看是否为视图*/ public Signs SearchById(int Id) { DBHelper.sqlstr = "select * from Signs where Id = @Id"; MySqlParameter[] param = new MySqlParameter[] { new MySqlParameter("@Id", Id) }; MySqlDataReader reader = DBHelper.ExecuteReader(param); Signs Obj = null; if (reader.Read()) { Obj = GetByReader(reader); } reader.Close(); return(Obj); }
public override void InitSigns() { //寻找的词性 Signs.Add("nt"); Signs.Add("nz"); //Signs.Add("nl"); //Signs.Add("nrj"); //Signs.Add("ng"); ////后面不允许出现的词性 //NextBanSigns.Add("n"); ////前面允许出现的词性 //FrontAllowSigns.Add("no-type"); //FrontAllowSigns.Add("v"); }
public async Task <IActionResult> AddOrEdit([Bind("SignId,Swedish,English,Russian,Arabic")] Signs signs) { if (ModelState.IsValid) { if (signs.SignId == 0) { _context.Add(signs); } else { _context.Update(signs); } await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(signs)); }
public override void OnInspectorGUI() { HotCursorManager signManager = target as HotCursorManager; EditorGUILayout.BeginVertical("GroupBox"); EditorGUILayout.LabelField("Options", EditorStyles.boldLabel); EditorGUILayout.Space(); signManager.raycastTo = (HotCursorManager.RaycastTo)EditorGUILayout.EnumPopup("Raycast To :", signManager.raycastTo); EditorGUILayout.Space(); signManager.useButton = (KeyCode)EditorGUILayout.EnumPopup("Use button :", signManager.useButton); EditorGUILayout.Space(); if(signManager.raycastTo != HotCursorManager.RaycastTo.MousePosition2D) { signManager.interactionRange = EditorGUILayout.Slider("Interaction Range :",signManager.interactionRange, 1.0f, 100.0f); EditorGUILayout.Space(); } EditorGUILayout.BeginHorizontal(); GUILayout.Label("Crosshair :"); signManager.crosshair = (Texture2D)EditorGUILayout.ObjectField(signManager.crosshair,typeof(Texture2D),allowSceneObjects:false); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); if(signManager.crosshair != null) { if(signManager.crosshairWH == Vector2.zero) { signManager.crosshairWH = new Vector2(signManager.crosshair.width,signManager.crosshair.height); } signManager.crosshairWH = EditorGUILayout.Vector2Field("Texture Size :", signManager.crosshairWH); } EditorGUILayout.Space();EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if(GUILayout.Button("Add New Cursor", "PreButton", GUILayout.Width(150))) { Signs sign = new Signs(); sign.tag = "Untagged"; signManager.signs.Add(sign); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); if(signManager.signs.Count > 0) { for(int i = 0; i < signManager.signs.Count; i++) { EditorGUILayout.BeginHorizontal(); signManager.signs[i].showToggle = GUILayout.Toggle(signManager.signs[i].showToggle, signManager.signs[i].tag, "OL Title"); GUI.color = Color.red; if(GUILayout.Button("Remove", "OL Title", GUILayout.Width(100))) { signManager.signs.RemoveAt(i); return; } GUI.color = Color.white; EditorGUILayout.EndHorizontal(); if(signManager.signs[i].showToggle) { EditorGUILayout.BeginVertical("ScriptText"); EditorGUI.indentLevel++; EditorGUILayout.Space(); EditorGUILayout.Space(); signManager.signs[i].tag = EditorGUILayout.TagField("Tag :",signManager.signs[i].tag, "PreDropDown"); EditorGUILayout.Space(); signManager.signs[i].show = (Signs.Show) EditorGUILayout.EnumPopup("Show :", signManager.signs[i].show , "PreDropDown"); EditorGUILayout.Space(); if(signManager.signs[i].show == Signs.Show.Texture) { if(!string.IsNullOrEmpty(signManager.signs[i].hint)) signManager.signs[i].hint = ""; signManager.signs[i].texture = (Texture2D)EditorGUILayout.ObjectField("Texture:",signManager.signs[i].texture,typeof(Texture2D),allowSceneObjects:false); EditorGUILayout.Space(); if(signManager.signs[i].texture != null) { if(signManager.signs[i].textureWH == Vector2.zero) { signManager.signs[i].textureWH = new Vector2(signManager.signs[i].texture.width,signManager.signs[i].texture.height); } signManager.signs[i].textureWH = EditorGUILayout.Vector2Field("Texture Size :",signManager.signs[i].textureWH); } } else { if(signManager.signs[i].texture != null) signManager.signs[i].texture = null; signManager.signs[i].hint = EditorGUILayout.TextField("Hint :",signManager.signs[i].hint); EditorGUILayout.Space(); signManager.signs[i].style.font = (Font)EditorGUILayout.ObjectField("Font :",signManager.signs[i].style.font,typeof(Font),allowSceneObjects:false); EditorGUILayout.Space(); signManager.signs[i].style.fontSize = EditorGUILayout.IntField("Font Size :",signManager.signs[i].style.fontSize); EditorGUILayout.Space(); signManager.signs[i].style.alignment = (TextAnchor)EditorGUILayout.EnumPopup("Alignment :",signManager.signs[i].style.alignment, "PreDropDown"); EditorGUILayout.Space(); if(signManager.signs[i].style.font != null) { signManager.signs[i].style.normal.textColor = EditorGUILayout.ColorField("Font Color : ",signManager.signs[i].style.normal.textColor); } signManager.signs[i].style.normal.background = (Texture2D)EditorGUILayout.ObjectField("Background :",signManager.signs[i].style.normal.background, typeof(Texture2D), false); if(signManager.signs[i].style.normal.background != null) { signManager.signs[i].hintTextureWH = EditorGUILayout.Vector2Field("Label W&H :", signManager.signs[i].hintTextureWH); } EditorGUILayout.Space(); } EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); } EditorGUILayout.Space();EditorGUILayout.Space(); } } EditorGUILayout.Space(); }