public void SetObjectData(ISerializationData dataHolder, ISerializationContext context) { m_activeIdentities = new Dictionary <Name, Identity>(); m_kb = dataHolder.GetValue <KB>("KnowledgeBase"); this.BodyName = dataHolder.GetValue <string>("BodyName"); this.VoiceName = dataHolder.GetValue <string>("VoiceName"); m_emotionalState = dataHolder.GetValue <ConcreteEmotionalState>("EmotionalState"); m_goals = new Dictionary <string, Goal>(); var goals = dataHolder.GetValue <Goal[]>("Goals"); if (goals != null) { foreach (var g in goals) { m_goals.Add(g.Name.ToString(), g); } } m_am = dataHolder.GetValue <AM>("AutobiographicMemory"); m_otherAgents = dataHolder.GetValue <Dictionary <Name, AgentEntry> >("OtherAgents"); if (m_otherAgents == null) { m_otherAgents = new Dictionary <Name, AgentEntry>(); } BindToRegistry(m_kb); }
public void Start() { Scene.endGame = false; // Background SBG = new ScrollingBackground(AM.GetTexture("Background.png"), 100.0); // Player ShipSpecs specs = new ShipSpecs(); specs.Level = 1; specs.Velocity = 400.0; specs.HP = 5; specs.MaxHP = 50; specs.Damage = 25; specs.MaxDamage = 100; specs.LazerCount = 1; specs.Cooldown = 0.3; player = new Ship(Scene, new DrawComponent(AM.GetTexture("Ship.png"), new Size(64.0, 64.0)), new TransformComponent(new Point(200.0, 700.0)), specs); Scene.NewActors.Add(player); PM.CreateBoxComponent(new Size(64.0, 64.0), player); State = GameState.InProgress; Window.ScoreBar.Maximum = MaxScore; }
private void MulitPlusCounter(object para) { List <object> paras = para as List <object>; int index = Convert.ToInt32(paras[0]); long target = Convert.ToInt64(paras[1]); AM am = null; if (paras.Count > 2) { am = paras[2] as AM; } Stopwatch sw = new Stopwatch(); string msg = string.Format("[{0}] Thread<{1}> started.\n", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), index); LogMsgs.Add(msg); sw.Start(); for (long i = 0; i < target; i++) { ; } sw.Stop(); Result[index] = sw.ElapsedMilliseconds; resultState[index] = true; am?.Invoke(); msg = string.Format("[{0}] Thread<{1}> stopped.\n", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), index); LogMsgs.Add(msg); }
public void PurchaseAmmoButton() { if (detectedFirearm == null || original.M.GetNumTokens() < PanelCost) { SM.PlayCoreSound(FVRPooledAudioType.UIChirp, original.AudEvent_Fail, transform.position); return; } else { SM.PlayCoreSound(FVRPooledAudioType.UIChirp, original.AudEvent_Spawn, transform.position); original.M.SubtractTokens(PanelCost); original.M.Increment(10, false); FVRObject.OTagFirearmRoundPower roundPower = AM.GetRoundPower(detectedFirearm.RoundType); int numSpawned = GetRoundsToSpawn(roundPower); TNHTweakerLogger.Log("Compatible rounds count for " + detectedFirearm.ObjectWrapper.ItemID + ": " + IM.OD[detectedFirearm.ObjectWrapper.ItemID].CompatibleSingleRounds.Count, TNHTweakerLogger.LogType.General); CustomCharacter character = LoadedTemplateManager.LoadedCharactersDict[original.M.C]; MagazineBlacklistEntry blacklistEntry = null; if (character.GetMagazineBlacklist().ContainsKey(detectedFirearm.ObjectWrapper.ItemID)) { blacklistEntry = character.GetMagazineBlacklist()[detectedFirearm.ObjectWrapper.ItemID]; } FVRObject compatibleRound = FirearmUtils.GetCompatibleRounds(detectedFirearm.ObjectWrapper, character.ValidAmmoEras, character.ValidAmmoSets, character.GlobalAmmoBlacklist, blacklistEntry).GetRandom(); AnvilManager.Run(SpawnRounds(compatibleRound, numSpawned)); detectedFirearm = null; UpdateIcons(); } }
private void generateButt_Click(object sender, RoutedEventArgs e) { long p, g; getRandPG(out p, out g); PField.Text = p.ToString(); GField.Text = g.ToString(); alise = new DH_Exschange(p, g); bob = new DH_Exschange(p, g); ASKey.Text = alise.getSecretKey().ToString(); BSKey.Text = bob.getSecretKey().ToString(); long AM, BM; AM = alise.getMiddleKey(); BM = bob.getMiddleKey(); AMKey.Text = AM.ToString(); BMKey.Text = BM.ToString(); long AF, BF; AF = alise.getFinKey(BM); BF = bob.getFinKey(AM); AFKey.Text = AF.ToString(); BFKey.Text = BF.ToString(); }
IEnumerator Reload() { if (GM.onFinalLevel1 == false && (!(GM.slainEnemies == 2 || GM.slainEnemies == 5) || GM.statusE[ID] == true)) { yield return(new WaitForSeconds(5f)); if (PlayerPrefs.GetInt("statusPref_" + ID) != 1) { if (GM.statusE[ID] == false) { GM.slainEnemies += 1; } GM.statusE[ID] = true; PlayerPrefs.SetInt("statusPref_" + ID, 1); } Debug.Log(GM.slainEnemies); AM.StopAll(); Debug.Log("Somehow we got here"); SceneManager.LoadScene(5); } yield return(null); }
public string ToString(AM am) { StringBuilder builder = ObjectPool <StringBuilder> .GetObject(); builder.AppendFormat("{0}: {1}", EmotionType, am.RecallEvent(CauseId).EventName); if (this.Target != null) { builder.AppendFormat(" {0}", this.Target); } if (this.EventName != null) { builder.AppendFormat(" {0}", this.EventName); } if (this.Target != null) { builder.AppendFormat(" {0}", this.Target); } var result = builder.ToString(); builder.Length = 0; ObjectPool <StringBuilder> .Recycle(builder); return(result); }
public void RemoveEmotion(IActiveEmotion em, AM am) { if (em != null) { this.emotionPool.Remove(calculateHashString(em)); } }
public override void Effect() { GameObject target = this.myFSM.GetFsmGameObject("Target").Value; AM.AddActionOnBottom(new FoldHandCardAction(target)); AM.AddActionOnBottom(new DrawCardAction(2)); }
public override void Effect() { GameObject target = this.myFSM.GetFsmGameObject("Target").Value; AM.AddActionOnBottom(new AddBuffAction(target, new Buff_10000(target.GetComponent <BattleUnitContainer>().BattleUnit, 1))); AM.AddActionOnBottom(new AttackAction(BM.PlayerGO, target, PlayerUnit.Attack)); }
public override void Effect() { GameObject target = this.myFSM.GetFsmGameObject("Target").Value; AM.AddActionOnBottom(new AttackAction(BM.PlayerGO, target, PlayerUnit.Attack)); AM.AddActionOnBottom(new AttackAction(BM.PlayerGO, target, PlayerUnit.Attack)); }
public AppraisalRule(Name eventName, ConditionSet conditions = null) { AM.AssertEventNameValidity(eventName); EventName = eventName; Conditions = conditions ?? new ConditionSet(); Desirability = Praiseworthiness = 0; }
public override double GetData() { double tmp; if (FM != null) { current += Math.PI * 2.0d * frequency * (1 + FM.GetData()) / sampleCount; } else { current += Math.PI * 2.0d * frequency / sampleCount; } if (AM != null) { tmp = ((Math.Asin(Math.Sin(current)) * amplitude * (1 + AM.GetData()) * 2 / Math.PI)); } else { tmp = ((Math.Asin(Math.Sin(current)) * amplitude * 2 / Math.PI)); } // current += step; return(tmp); }
public async Task <ActionResult <string> > Post(AM am) { BigInteger a; uint m; try { if (am.a == null || am.m == null) { throw new FormatException(); } a = BitOperation.BinStrToBigInteger(am.a); m = Convert.ToUInt32(am.m, 10); if (m > 32 || am.a.Length > 32) { throw new FormatException(); } } catch (FormatException) { ModelState.AddModelError("Error", "Некорректные параметры"); return(BadRequest(ModelState)); } return(await Task.Run(() => BitOperation.BigIntegerToBinStr(BitOperation.ZeroSmallBits(a, m)))); }
protected internal void Subscribe() { if (this.IsNull(Act) == true) { Act = new AM <System.EventHandler>(); Act.Set(new EventHandler(FirstAction)); } }
public override void Effect() { AM.AddActionOnBottom(new DrawCardAction(1)); ChooseTargetAction action = new ChooseCardTargetAction(); AM.AddActionOnBottom(action); AM.AddActionOnBottom(new MoveCardToDrawPile(action, 0)); }
public override global::System.Data.DataSet Clone() { AM cln = ((AM)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
// Start is called before the first frame update void Start() { ID = 1; Hit.enabled = false; HitImage.enabled = false; seeker = GetComponent <Seeker>(); AM = FindObjectOfType <AudioManager>(); GM = FindObjectOfType <GameManager>(); //GM = GameObject.FindGameObjectWithTag("GameManager"); LC = GM.LegList[1]; HC = GM.HeadList[1]; TC = GM.TorsoList[1]; WrC = GM.WeaponRList[1]; WlC = GM.WeaponLList[1]; SRLegs.sprite = LC.part; SRLegs.material = LC.Emitter; SRHead.sprite = HC.part; SRHead.material = HC.Emitter; SRTorso.sprite = TC.part; SRTorso.material = TC.Emitter; SRWeaponR.sprite = WrC.part; SRWeaponR.material = WrC.Emitter; SRWeaponL.sprite = WlC.part; SRWeaponL.material = WlC.Emitter; Anim = legsChildren.GetComponent <Animator>(); Anim.SetInteger("ArmorID", 1); SRLegs.sprite = LC.part; Anim.speed = 0; currentHP = HC.hp + TC.hp + LC.hp; maxHP = HC.hp + TC.hp + LC.hp; maxEnergy = TC.energy; currentEnergy = maxEnergy; currentAmmoL = WlC.ammo; currentAmmoR = WrC.ammo; BarrelL.position = new Vector2(BarrelL.position.x, BarrelL.position.y + WlC.barrelLength); BarrelR.position = new Vector2(BarrelR.position.x, BarrelR.position.y + WrC.barrelLength); //isBoosting = true; currentTarget = movePoints[Random.Range(0, 3)]; if (AM.Playing("MenuSong")) { AM.Stop("MenuSong"); } //AM.Play("DesertSong"); if (Boosters.isPlaying) { Boosters.Stop(); } if (overBoosters.isPlaying) { overBoosters.Stop(); } int nextSpot = Random.Range(0, movePoints.Count); seeker.StartPath(rb.position, movePoints[nextSpot].position, OnPathComplete); InvokeRepeating("UpdatePath", 0f, 0.5f); }
void Awake() { am = AM.Get(); ASMain = GetComponent<AudioSource>(); ASAccHigh = gameObject.AddComponent<AudioSource>(); ASAccHigh.clip = am.sfx[(int)SFX.AccelHigh - 1]; ASAccHigh.volume = 0; ASAccHigh.loop = true; ASAccHigh.Play(); ASAccLow = gameObject.AddComponent<AudioSource>(); ASAccLow.clip = am.sfx[(int)SFX.AccelLow - 1]; ASAccLow.volume = 0; ASAccLow.loop = true; ASAccLow.Play(); ASDeHigh = gameObject.AddComponent<AudioSource>(); ASDeHigh.clip = am.sfx[(int)SFX.DeccelHigh - 1]; ASDeHigh.volume = 0; ASDeHigh.loop = true; ASDeHigh.Play(); ASDeLow = gameObject.AddComponent<AudioSource>(); ASDeLow.clip = am.sfx[(int)SFX.DeccelLow - 1]; ASDeLow.volume = 0; ASDeLow.loop = true; ASDeLow.Play(); revs = 0.0f; engineStart = true; rb = GetComponent<Rigidbody>(); rb.centerOfMass = new Vector3(0.0f, -1.0f, 0.0f); Wheel[] wheels = { frWheel, flWheel, rrWheel, rlWheel }; for (int i=0; i<wheels.Length; ++i) { Wheel wheel = wheels[i]; Suspension spring = wheel.suspensionSpring; spring.spring = 50000; spring.damper = 10000; wheel.suspensionSpring = spring; wheel.suspensionDistance = 0.1f; wheel.wheelRadius = 0.4f; wheel.wheelMass = 1.0f; wheel.forwardFrictionCurve = new CustomFrictionCurve(); wheel.forwardFrictionCurve.ExtremumSlip = 3.0f; wheel.forwardFrictionCurve.ExtremumValue = 6000.0f; wheel.forwardFrictionCurve.AsymptoteSlip = 4.0f; wheel.forwardFrictionCurve.AsymptoteValue = 6000.0f; wheel.forwardFrictionCurve.Stiffness = 3.0f; wheel.sidewayFrictionCurve = new CustomFrictionCurve(); wheel.sidewayFrictionCurve.ExtremumSlip = 3.0f; wheel.sidewayFrictionCurve.ExtremumValue = 4000.0f; wheel.sidewayFrictionCurve.AsymptoteSlip = 4.0f; wheel.sidewayFrictionCurve.AsymptoteValue = 4000.0f; wheel.sidewayFrictionCurve.Stiffness = 5.0f; } }
private static AM BuildAMAsset() { var am = new AM() { Tick = 0, }; return(am); }
public RolePlayCharacterAsset() { m_activeIdentities = new Dictionary <Name, Identity>(); m_kb = new KB(RPCConsts.DEFAULT_CHARACTER_NAME); m_am = new AM(); m_emotionalState = new ConcreteEmotionalState(); m_goals = new Dictionary <string, Goal>(); m_otherAgents = new Dictionary <Name, AgentEntry>(); BindToRegistry(m_kb); }
public List <double> Generate() { Values.Clear(); for (int i = 1; i <= ValuesCount; i++) { Values.Add(GenerateValue() * (1 + (AM?.GenerateValue() ?? 0))); } return(Values); }
public EmotionDTO ToDto(AM am) { return(new EmotionDTO { Type = this.EmotionType, Intensity = this.Intensity, CauseEventId = this.CauseId, CauseEventName = am.RecallEvent(this.CauseId).EventName.ToString(), }); }
public void UpdateProxyRenderers() { if (this.ProxyRounds.Count > 0) { for (int i = 0; i < this.ProxyRounds.Count; i++) { this.ProxyRounds[i].Filter.mesh = AM.GetRoundMesh(this.ProxyRounds[i].Type, this.ProxyRounds[i].Class); this.ProxyRounds[i].Renderer.material = AM.GetRoundMaterial(this.ProxyRounds[i].Type, this.ProxyRounds[i].Class); } } }
public EmotionalAppraisalAsset(string perspective) { m_kb = new KB((Name)perspective); m_am = new AM(); m_am.BindCalls(m_kb); m_emotionalState = new ConcreteEmotionalState(this); m_occAffectDerivator = new OCCAffectDerivationComponent(); m_appraisalDerivator = new ReactiveAppraisalDerivator(); BindCalls(m_kb); }
public RolePlayCharacterAsset() { m_log = new List <LogEntry>(); m_activeIdentities = new Dictionary <Name, Identity>(); m_kb = new KB(RPCConsts.DEFAULT_CHARACTER_NAME); m_am = new AM(); m_emotionalState = new ConcreteEmotionalState(); m_allowAuthoring = true; m_otherAgents = new Dictionary <Name, AgentEntry>(); BindToRegistry(m_kb); }
public override double GetData() { if (AM != null) { return(random.Next((int)(-amplitude * (1 + AM.GetData())), (int)(amplitude * (1 + AM.GetData())))); } else { return(random.Next((int)(-amplitude), (int)(amplitude))); } }
public EmotionDTO ToDto(AM am) { return(new EmotionDTO { Type = this.EmotionType, Intensity = this.Intensity, Target = this.Target == null ? Name.NIL_STRING : this.Target.ToString(), CauseEventId = this.CauseId, CauseEventName = am.RecallEvent(this.CauseId).EventName.ToString(), }); }
public override void Effect() { AM.AddActionOnBottom(new DrawCardAction(1)); CallComboEffect(delegate() { AM.AddActionOnBottom(new DrawCardAction(1)); }); // if (CardManager._instance.UsedCardCount >= 2) // { // AM.AddActionOnBottom(new DrawCardAction(1)); // } }
// Start is called before the first frame update void Start() { ID = 1; Hit.enabled = false; HitImage.enabled = false; seeker = GetComponent <Seeker>(); AM = FindObjectOfType <AudioManager>(); GM = FindObjectOfType <GameManager>(); //GM = GameObject.FindGameObjectWithTag("GameManager"); LC = GM.LegList[0]; HC = GM.HeadList[0]; TC = GM.TorsoList[0]; WrC = GM.WeaponRList[0]; WlC = GM.WeaponLList[0]; SRLegs.sprite = LC.part; SRLegs.material = LC.Emitter; SRHead.sprite = HC.part; SRHead.material = HC.Emitter; SRTorso.sprite = TC.part; SRTorso.material = TC.Emitter; SRWeaponR.sprite = WrC.part; SRWeaponR.material = WrC.Emitter; SRWeaponL.sprite = WlC.part; SRWeaponL.material = WlC.Emitter; Anim = legsChildren.GetComponent <Animator>(); Anim.SetInteger("ArmorID", 0); SRLegs.sprite = LC.part; Anim.speed = 0; currentHP = 9999; maxHP = HC.hp + TC.hp + LC.hp; maxEnergy = TC.energy; currentEnergy = maxEnergy; currentAmmoL = WlC.ammo; currentAmmoR = WrC.ammo; BarrelL.position = new Vector2(BarrelL.position.x, BarrelL.position.y + WlC.barrelLength); BarrelR.position = new Vector2(BarrelR.position.x, BarrelR.position.y + WrC.barrelLength); //isBoosting = true; if (AM.Playing("MenuSong")) { AM.Stop("MenuSong"); } if (Boosters.isPlaying) { Boosters.Stop(); } if (overBoosters.isPlaying) { overBoosters.Stop(); } }
/// <summary> /// After data has been read, extract operator records from the collected data. /// </summary> private void ExtractOperatorRecords() { foreach (String key in HD.Keys) { OperatorRecord rec = new OperatorRecord(); List <String> hd = HD[key].Fields; Tuple <RadioService, String> serviceType = GetRadioServiceType(hd[6]); rec.CallSign = key; rec.RadioService = serviceType.Item1; rec.RadioServiceDescription = serviceType.Item2; rec.LicenseKey = hd[1]; rec.Frequency = hd[2]; rec.Granted = ParseNullableDate(hd[7]); rec.Expiration = ParseNullableDate(hd[8]); rec.Cancelled = ParseNullableDate(hd[9]); rec.Effective = ParseNullableDate(hd[42]); if (EN.ContainsKey(key)) { List <String> en = EN[key].Fields; rec.Organization = Util.ToTitleCase(en[7]); rec.FirstName = Util.ToTitleCase(en[8]); rec.MiddleInitial = Util.ToTitleCase(en[9]); rec.LastName = Util.ToTitleCase(en[10]); rec.Suffix = Util.ToTitleCase(en[11]); rec.Address = Util.ToTitleCase(en[15])?.Replace("Th ", "th "); } if (AM.ContainsKey(key)) { List <String> am = AM[key].Fields; Tuple <OperatorClass, String> ocType = GetOperatorClassType(am[5]); rec.OperatorClass = ocType.Item1; rec.OperatorClassDescription = ocType.Item2; rec.Group = am[6]; } if (LM.ContainsKey(key)) { List <String> lm = LM[key].Fields; rec.LicenseEligibility = lm[6]; } if (HS.ContainsKey(key)) { rec.History.AddRange(HS[key].OrderBy(x => x.Date).ToList()); } Operators.Add(rec); } }