Inheritance: ModuleRules
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
    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);
    }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 public void RemoveEmotion(IActiveEmotion em, AM am)
 {
     if (em != null)
     {
         this.emotionPool.Remove(calculateHashString(em));
     }
 }
Ejemplo n.º 9
0
    public override void Effect()
    {
        GameObject target = this.myFSM.GetFsmGameObject("Target").Value;

        AM.AddActionOnBottom(new FoldHandCardAction(target));
        AM.AddActionOnBottom(new DrawCardAction(2));
    }
Ejemplo n.º 10
0
    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));
    }
Ejemplo n.º 11
0
    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));
    }
Ejemplo n.º 12
0
 public AppraisalRule(Name eventName, ConditionSet conditions = null)
 {
     AM.AssertEventNameValidity(eventName);
     EventName    = eventName;
     Conditions   = conditions ?? new ConditionSet();
     Desirability = Praiseworthiness = 0;
 }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        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))));
        }
Ejemplo n.º 15
0
 protected internal void Subscribe()
 {
     if (this.IsNull(Act) == true)
     {
         Act = new AM <System.EventHandler>();
         Act.Set(new EventHandler(FirstAction));
     }
 }
Ejemplo n.º 16
0
    public override void Effect()
    {
        AM.AddActionOnBottom(new DrawCardAction(1));
        ChooseTargetAction action = new ChooseCardTargetAction();

        AM.AddActionOnBottom(action);
        AM.AddActionOnBottom(new MoveCardToDrawPile(action, 0));
    }
Ejemplo n.º 17
0
        public override global::System.Data.DataSet Clone()
        {
            AM cln = ((AM)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Ejemplo n.º 18
0
    // 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);
    }
Ejemplo n.º 19
0
    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;
        }
    }
Ejemplo n.º 20
0
        private static AM BuildAMAsset()
        {
            var am = new AM()
            {
                Tick = 0,
            };

            return(am);
        }
Ejemplo n.º 21
0
 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);
        }
Ejemplo n.º 23
0
 public EmotionDTO ToDto(AM am)
 {
     return(new EmotionDTO
     {
         Type = this.EmotionType,
         Intensity = this.Intensity,
         CauseEventId = this.CauseId,
         CauseEventName = am.RecallEvent(this.CauseId).EventName.ToString(),
     });
 }
Ejemplo n.º 24
0
 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);
         }
     }
 }
Ejemplo n.º 25
0
        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);
        }
Ejemplo n.º 26
0
 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);
 }
Ejemplo n.º 27
0
Archivo: Noise.cs Proyecto: Shampyn/DSG
 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)));
     }
 }
Ejemplo n.º 28
0
 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(),
     });
 }
Ejemplo n.º 29
0
 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));
     // }
 }
Ejemplo n.º 30
0
    // 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);
            }
        }