public static async Task CreateNeutralAsync(GameServiceClient client) { var neutral = new Neutral(); neutral.Name = ConsoleUtility.GetUserInput("Neutral Name: "); neutral.GamePackageId = await GamePackageUtility.SelectGamePackageId(client); if (!ConsoleUtility.ShouldContinue($"Creating Neutral: '{neutral.Name}', in gamePackage '{neutral.GamePackageId}'")) { await CreateNeutralAsync(client); return; } var createRequest = new CreateNeutralsRequest(); createRequest.Neutrals.Add(neutral); var createReply = await client.CreateNeutralsAsync(createRequest); if (createReply.Status.Code != 200) { ConsoleUtility.WriteLine($"Failed to create neutral: {createReply.Status.Message}"); } else { ConsoleUtility.WriteLine($"Neutral '{createReply.Neutrals.First().Name}' was created with Id '{createReply.Neutrals.First().Id}'"); } }
// Use this for initialization void Start() { booster = GetComponent<Booster>(); neutral = GetComponent<Neutral>(); Now = State.Neutral; frameNow = Time.frameCount; }
// Use this for initialization void Start() { moveState = GetComponent<MoveState>(); booster = GetComponent<Booster>(); neutral = GetComponent<Neutral>(); rigidbody = GetComponent<Rigidbody>(); rigidbody.velocity = Vector3.forward * 1.0f; }
public override int GetHashCode() { return(Anger.GetHashCode() ^ Disgust.GetHashCode() ^ Fear.GetHashCode() ^ Happiness.GetHashCode() ^ Neutral.GetHashCode() ^ Sadness.GetHashCode() ^ Surprise.GetHashCode()); }
protected bool Equals(EmotionScores other) { return(Anger.Equals(other.Anger) && Contempt.Equals(other.Contempt) && Disgust.Equals(other.Disgust) && Fear.Equals(other.Fear) && Happiness.Equals(other.Happiness) && Neutral.Equals(other.Neutral) && Sadness.Equals(other.Sadness) && Surprise.Equals(other.Surprise)); }
public override int GetHashCode() { unchecked { var hashCode = Anger.GetHashCode(); hashCode = (hashCode * 397) ^ Contempt.GetHashCode(); hashCode = (hashCode * 397) ^ Disgust.GetHashCode(); hashCode = (hashCode * 397) ^ Fear.GetHashCode(); hashCode = (hashCode * 397) ^ Happiness.GetHashCode(); hashCode = (hashCode * 397) ^ Neutral.GetHashCode(); hashCode = (hashCode * 397) ^ Sadness.GetHashCode(); hashCode = (hashCode * 397) ^ Surprise.GetHashCode(); return(hashCode); } }
public override string ToString() { string result = Timestamp.ToString(); result += ";" + Neutral.ToString(); result += ";" + Happy.ToString(); result += ";" + Sad.ToString(); result += ";" + Angry.ToString(); result += ";" + Surprised.ToString(); result += ";" + Scared.ToString(); result += ";" + Disgusted.ToString(); result += ";" + Contempt.ToString(); result += ";" + Valence.ToString(); result += ";" + Arousal.ToString(); return(result); }
private static async ValueTask <IReadOnlyList <Neutral> > CreateNeutrals(GameServiceClient client, IReadOnlyList <GamePackage> packages) { ConsoleUtility.WriteLine("Creating neutrals"); List <Neutral> result = (await NeutralUtility.GetNeutralsAsync(client, null)).ToList(); if (result.Any()) { return(result); } foreach (var file in Directory.EnumerateFiles(@"C:\Users\Ryan\SkyDrive\code\LegendaryGameStarter\LegendaryGameModel2\GameSets", s_fileMask)) { var doc = XDocument.Load(file); var name = doc.Element("Set").Attribute("Name").Value; var activeGamePackage = packages.FirstOrDefault(x => x.Name == name); if (activeGamePackage == null) { ConsoleUtility.WriteLine($"Failed to find matching game package for {file}"); } foreach (var neutralElement in doc.Element("Set").Element("Cards").Elements("Card").Where(x => x?.Attribute("Area").Value == "Neutral")) { var request = new CreateNeutralsRequest(); request.CreateOptions.Add(CreateOptions.ErrorOnDuplicates); var neutral = new Neutral(); neutral.Name = neutralElement.Attribute("Name").Value; neutral.GamePackageId = activeGamePackage.Id; request.Neutrals.Add(neutral); var reply = await client.CreateNeutralsAsync(request); if (reply.Status.Code != 200) { ConsoleUtility.WriteLine($"Failed to create '{neutral.Name}': {reply.Status.Message}"); } result.AddRange(reply.Neutrals); } } return(result); }
/* No database, so we create and add our initial users * in this function */ private static void generateUser(Platform Platform) { List <string> userGameList1 = gameListGenerator(); Neutral newUser = new Neutral(232, userGameList1, 12, 4, 10000, 90000, 93, 82); List <string> userGameList2 = gameListGenerator(); Neutral newUser2 = new Neutral(233, userGameList2, 9, 6, 3000, 40000, 32, 19); List <string> userGameList3 = gameListGenerator(); Neutral newUser3 = new Neutral(234, userGameList3, 0.2, 23, 400, 3000, 10000, 23); List <string> userGameList4 = gameListGenerator(); Neutral newUser4 = new Neutral(235, userGameList4, 0.5, 0, 100, 300, 45, 35); List <string> userGameList5 = gameListGenerator(); Neutral newUser5 = new Neutral(236, userGameList5, 6, 25, 10000, 10000, 93, 22); Platform.AddUser(newUser); Platform.AddUser(newUser2); Platform.AddUser(newUser3); Platform.AddUser(newUser4); Platform.AddUser(newUser5); }
private void Actor_Spawn(object sender, SpawnEventArgs e) { Actor spawnedActor = (Actor)sender; if (spawnedActor.className == "player") { protagonist = spawnedActor; } else { ActionList behaviorList = new ActionList(spawnedActor); Neutral neutral = new Neutral(behaviorList, spawnedActor); behaviorList.pushFront(neutral); Alert alert = new Alert(behaviorList, spawnedActor, protagonist); behaviorList.pushFront(alert); behaviorLists[spawnedActor] = behaviorList; } //actors.Add(spawnedActor); }
public override Core.Misc.Map ToJson() { Core.Misc.Map data = new Core.Misc.Map(); data["name"] = this.name; data["model"] = this.model; data.SetVector3("bornPos1", this.bornPos1); data.SetVector3("bornDir1", this.bornDir1); data.SetVector3("bornPos2", this.bornPos2); data.SetVector3("bornDir2", this.bornDir2); data["bornRnd"] = this.bornRnd; int count = this.neutrals.Length; Core.Misc.Map[] maps = new Core.Misc.Map[count]; for (int i = 0; i < count; i++) { Neutral neutral = this.neutrals[i]; maps[i] = neutral.ToJson(); } data["neutrals"] = maps; return(data); }
/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. if (CurrentBar < period) { return; } double value = CCI(period)[0]; if (value > 200) { BackColor = Color.PaleGreen; BarColor = Color.Yellow; CandleOutlineColor = Color.Black; } else if (value > 150) { BackColor = Color.PaleGreen; } else if (value < -200) { BackColor = Color.Pink; BarColor = Color.Yellow; CandleOutlineColor = Color.Black; } else if (value < -150) { BackColor = Color.Pink; } Above.Set(value); Neutral.Set(value); Below.Set(value); }
public override void FromJson(Core.Misc.Map data) { this.name = data.GetString("name"); this.model = data.GetString("model"); this.bornPos1 = data.GetVector3("bornPos1"); this.bornDir1 = data.GetVector3("bornDir1"); this.bornPos2 = data.GetVector3("bornPos2"); this.bornDir2 = data.GetVector3("bornDir2"); this.bornRnd = data.GetFloat("bornRnd"); ArrayList al = data.GetList("neutrals"); int count = al.Count; this.neutrals = new Neutral[count]; for (int i = 0; i < count; i++) { Core.Misc.Map m = (Core.Misc.Map)al[i]; Neutral neutral = new Neutral(); neutral.FromJson(m); neutral.parent = this; this.neutrals[i] = neutral; } this.MakePropertyNode(ref data); }
// Use this for initialization void Start () { neutral = GetComponent<Neutral>(); movementDirection = transform.forward; }
/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { if (CurrentBar < length) { return; } LRReversal.Set(LinReg(Close, Length)[0]); lRR.Set(LinReg(Close, Length)[0]); if (LRReversal[0] >= LRReversal[1]) { lRR[0] = 1; } else { lRR[0] = -1; } bool rising = false; bool falling = false; if (lRR[0] == 1) //> lRR[1]) { Rising.Set(lRR[0]); //Rising.Set(1, lRR[1]); rising = true; // if (ColorBars) // { CandleOutlineColor = BarColorOutline; BarColor = BarColorUp; } } // else if (lRR[0] == -1) //< lRR[1]) { Falling.Set(lRR[0]); //Falling.Set(1, lRR[1]); falling = true; // if (ColorBars) // { CandleOutlineColor = BarColorOutline; BarColor = BarColorDown; } } //else if //((lRR[0] > lRR[1]) || (lRR[0] < lRR[1])) ((lRR[1] == 1 && lRR[0] == -1) || (lRR[1] == -1 && lRR[0] == 1)) { Neutral.Set(lRR[0]); Neutral.Set(1, lRR[1]); rising = false; falling = false; // if (ColorBars) // { CandleOutlineColor = BarColorOutline; BarColor = BarColorNeutral; } } /////////////////////////////////////////////////////////////////////////////////////////////// /// draw dot at second instance of +1 or -1 /////////////////////////////////////////////////////////////////////////////////// if (drawDots) { if (LRR[2] == -1 && LRR[1] == 1 && LRR[0] == 1 ) { DrawDot("Dot" + CurrentBar, false, 0, 0, Color.Blue); signal.Set(1); } else if (LRR[2] == 1 && LRR[1] == -1 && LRR[0] == -1 ) { DrawDot("Dot" + CurrentBar, false, 0, 0, Color.Red); signal.Set(-1); } else { RemoveDrawObject("Dot"); } } if (signal[1] != 1 && signal[0] == 1) { if (DrawLines) { DrawVerticalLine("tag1l" + CurrentBar, 0, Color.Blue, DashStyle.DashDot, 3); //DrawDot("tag1d"+CurrentBar,false,0,Low[0] - 8*TickSize,Color.Blue); } } if (signal[1] != -1 && signal[0] == -1) { if (DrawLines) { DrawVerticalLine("tag2l" + CurrentBar, 0, Color.Red, DashStyle.DashDot, 3); //DrawDot("tag2d"+CurrentBar,false,0,High[0] + 8*TickSize,Color.Red); } } }
/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { if (newbarsound) { if (FirstTickOfBar) { PlaySound(newbarwavfilename); // Added by TheWizard 02/06/10 } } if (CurrentBar < 2) { PDM.Set(0); MDM.Set(0); PDI.Set(0); MDI.Set(0); Out.Set(0); Main.Set(0); Rising.Set(0); Falling.Set(0); Neutral.Set(0); return; } try { if (lastCalcBar != CurrentBar) { lastCalcBar = CurrentBar; // setData( data, 0, 0d ); // colorBar( 1 ); lastDirection = direction; } int i = 0; PDM.Set(0); MDM.Set(0); if (Close[i] > Close[i + 1]) { PDM.Set(Close[i] - Close[i + 1]); //This array is not displayed. } else { MDM.Set(Close[i + 1] - Close[i]); //This array is not displayed. } PDM.Set(((WeightDM - 1) * PDM[i + 1] + PDM[i]) / WeightDM); //ema. MDM.Set(((WeightDM - 1) * MDM[i + 1] + MDM[i]) / WeightDM); //ema. double TR = PDM[i] + MDM[i]; if (TR > 0) { PDI.Set(PDM[i] / TR); MDI.Set(MDM[i] / TR); } //Avoid division by zero. Minimum step size is one unnormalized price pip. else { PDI.Set(0); MDI.Set(0); } PDI.Set(((WeightDI - 1) * PDI[i + 1] + PDI[i]) / WeightDI); //ema. MDI.Set(((WeightDI - 1) * MDI[i + 1] + MDI[i]) / WeightDI); //ema. double DI_Diff = PDI[i] - MDI[i]; if (DI_Diff < 0) { DI_Diff = -DI_Diff; //Only positive momentum signals are used. } double DI_Sum = PDI[i] + MDI[i]; double DI_Factor = 0; //Zero case, DI_Diff will also be zero when DI_Sum is zero. if (DI_Sum > 0) { Out.Set(DI_Diff / DI_Sum); //Factional, near zero when PDM==MDM (horizonal), near 1 for laddering. } else { Out.Set(0); } Out.Set(((WeightDX - 1) * Out[i + 1] + Out[i]) / WeightDX); if (Out[i] > Out[i + 1]) { HHV = Out[i]; LLV = Out[i + 1]; } else { HHV = Out[i + 1]; LLV = Out[i]; } for (int j = 1; j < Math.Min(ADXPeriod, CurrentBar); j++) { if (Out[i + j + 1] > HHV) { HHV = Out[i + j + 1]; } if (Out[i + j + 1] < LLV) { LLV = Out[i + j + 1]; } } double diff = HHV - LLV; //Veriable reference scale, adapts to recent activity level, unnormalized. double VI = 0; //Zero case. This fixes the output at its historical level. if (diff > 0) { VI = (Out[i] - LLV) / diff; //Normalized, 0-1 scale. } // if (VI_0.VIsq_1.VIsqroot_2==1)VI*=VI; // if (VI_0.VIsq_1.VIsqroot_2==2)VI=MathSqrt(VI); // if (VI>VImax)VI=VImax;//Used by Bemac with VImax=0.4, still used in vma1 and affects 5min trend definition. //All the ema weight settings, including Chande, affect 5 min trend definition. // if (VI<=zeroVIbelow)VI=0; main.Set(((ChandeEMA - VI) * main[i + 1] + VI * Close[i]) / ChandeEMA); //Chande VMA formula with ema built in. bool rising = false; bool falling = false; if (conservativemode) { if (main[0] > main[1]) { Rising.Set(main[0]); if (main[1] <= main[2] && Plots[0].PlotStyle == PlotStyle.Line) { Rising.Set(1, main[1]); } rising = true; if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorUp); // added By TheWizard 02/06/10 } if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = Color.Transparent; CandleOutlineColor = barColorUp; } else { BarColor = BarColorUp; } } } else if (main[0] < main[1]) { Falling.Set(main[0]); if (main[1] >= main[2] && Plots[1].PlotStyle == PlotStyle.Line) { Falling.Set(1, main[1]); } falling = true; if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorDn); // added By TheWizard 02/06/10 } if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = Color.Transparent; CandleOutlineColor = barColorDown; } else { BarColor = BarColorDown; } } } else { Neutral.Set(main[0]); Neutral.Set(1, main[1]); rising = false; falling = false; if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = BarColorNeutral; CandleOutlineColor = BarColorOutline; } else { BarColor = BarColorNeutral; } } } } if (!conservativemode) { if (main[0] > main[1]) { Rising.Set(main[0]); Rising.Set(1, main[1]); rising = true; if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorUp); // added By TheWizard 02/06/10 } if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = Color.Transparent; CandleOutlineColor = barColorUp; } else { BarColor = BarColorUp; } } } else if (main[0] < main[1]) { Falling.Set(main[0]); Falling.Set(1, main[1]); falling = true; if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorDn); // added By TheWizard 02/06/10 } if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = Color.Transparent; CandleOutlineColor = barColorDown; } else { BarColor = BarColorDown; } } } else if (main[0] == main[0] && Median[0] > main[0]) { Rising.Set(main[0]); Rising.Set(1, main[1]); rising = true; if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorUp); // added By TheWizard 02/06/10 } if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = Color.Transparent; CandleOutlineColor = barColorUp; } else { BarColor = BarColorUp; } } } else if (main[0] == main[0] && Median[0] < main[0]) { Falling.Set(main[0]); Falling.Set(1, main[1]); falling = true; if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorDn); // added By TheWizard 02/06/10 } if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = Color.Transparent; CandleOutlineColor = barColorDown; } else { BarColor = BarColorDown; } } } else { Neutral.Set(main[0]); Neutral.Set(1, main[1]); rising = false; falling = false; if (ColorBars) { if (ChartControl.ChartStyleType == ChartStyleType.CandleStick) // modified by TheWizard Feb 5, 2010 to allow for hollow-style candlesticks { BarColor = BarColorNeutral; CandleOutlineColor = BarColorOutline; } else { BarColor = BarColorNeutral; } } } } if (rising) { Signal.Set(1); if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorUp); // added By TheWizard 02/06/10 } } else if (falling) { Signal.Set(-1); if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorDn); // added By TheWizard 02/06/10 } } else { Signal.Set(0); } if (Signal[0] == 0 && Signal[1] != 0) { if (showDiamonds && CurrentBar >= 0) { double val1 = Neutral[i + 1] + (TickSize * DiamondDisplacement); double val2 = Neutral[i + 1] - (TickSize * DiamondDisplacement); DrawDiamond("topdiamond" + CurrentBar.ToString(), false, 1, val1, DiamondColor); DrawDiamond("botdiamond" + CurrentBar.ToString(), false, 1, val2, DiamondColor); } if (diamondsoundon && FirstTickOfBar) { PlaySound(diamondalertwavfilename); } // Print("Signal: " +Signal.ToString()); } if (ShowArrows && CurrentBar >= 0) //> 2) { //if( lastDirection < direction ) if (Signal[0] == 1 && Signal[1] != 1) { double val = Low[i + 1] - (TickSize * ArrowDisplacement); if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorUp); // added By TheWizard 02/06/10 } if (FirstTickOfBar) { DrawArrowUp(CurrentBar.ToString(), 1, val, barColorUp); } //data[ data.Count - 1] = val * -1; //setData( data, bar, val * -1 ); if (arrowsoundon && FirstTickOfBar) { PlaySound(longwavfilename); } } //else if( lastDirection > direction ) else if (Signal[0] == -1 && Signal[1] != -1) { double val = High[i + 1] + (TickSize * ArrowDisplacement); if (colorbackground) { BackColor = Color.FromArgb(opacity, BackColorDn); // added By TheWizard 02/06/10 } if (FirstTickOfBar) { DrawArrowDown(CurrentBar.ToString(), 1, val, barColorDown); } if (arrowsoundon && FirstTickOfBar) { PlaySound(shortwavfilename); } //setData( data, bar, val ); } } //--Text Box Info--// // double ECOminus = Math.Abs(eco[1]-eco[0]); // double ECOplus = Math.Abs(eco[0]-eco[1]); if (textOnLeft) { if (textOnTop) { tPosition = TextPosition.TopLeft; } else { bPosition = TextPosition.BottomLeft; } } else { if (!textOnTop) { bPosition = TextPosition.BottomRight; } else { tPosition = TextPosition.TopRight; } } if (showText) { if (Signal[0] == 1) { DrawTextFixed("Rising", " RISING ", tPosition, Color.White, textFontMed, Color.Black, Color.Blue, 10); } else { RemoveDrawObject("Rising"); } if (Signal[0] == -1) { DrawTextFixed("Falling", " FALLING ", tPosition, Color.White, textFontMed, Color.Black, Color.Red, 10); } else { RemoveDrawObject("Falling"); } if (Signal[0] == 0) { DrawTextFixed("Neutral", " NEUTRAL ", tPosition, Color.Black, textFontMed, Color.Black, Color.Goldenrod, 3); } else { RemoveDrawObject("Neutral"); } } } catch (Exception ex) { Print(ex.ToString()); } }
public override string ToString() { return($" {LovedText}/{Loved.Serialize()}/{LikedText}/{Liked.Serialize()}/{DislikedText}/{Disliked.Serialize()}" + $"/{HatedText}/{Hated.Serialize()}/{NeutralText}/{Neutral.Serialize()}/ "); }
public ReleaseNotes(Neutral Neutral) { neutral = Neutral; }