public void EveryNthtest(string str, int n, string expected) { Conditionals test = new Conditionals(); string actual = test.EveryNth(str, n); Assert.AreEqual(expected, actual); }
static void Main(string[] args) { Conditionals.Exercise1(); Conditionals.Exercise2(); Conditionals.LandscapeOrPortrait(); Conditionals.SpeedCamera(); }
public void GotE(string str, bool expected) { Conditionals test = new Conditionals(); bool actual = test.GotE(str); Assert.AreEqual(expected, actual); }
public void MaxTest(int a, int b, int c, int expected) { Conditionals test = new Conditionals(); int actual = test.Max(a, b, c); Assert.AreEqual(expected, actual); }
public void CloserTest(int a, int b, int expected) { Conditionals test = new Conditionals(); int actual = test.Closer(a, b); Assert.AreEqual(expected, actual); }
public bool IsAvailable(Vector3 direction) { conditional = Conditionals.PositionAvailable; variable1 = direction; moveEvent.WaitOne(); return(result); }
public void StartOzTest(string str, string expected) { Conditionals test = new Conditionals(); string actual = test.StartOz(str); Assert.AreEqual(expected, actual); }
void AssertNonBranchHasNoConditionals() { if (!IsBranch) { Debug.Assert(Conditionals == null || Conditionals.IsEmpty(), "Conditionals should never be set for a non-branch."); } }
public void NearHundred(int a, bool expected) { Conditionals test = new Conditionals(); bool actual = test.NearHundred(a); Assert.AreEqual(expected, actual); }
public void IcyHottest(int temp1, int temp2, bool expected) { Conditionals test = new Conditionals(); bool actual = test.IcyHot(temp1, temp2); Assert.AreEqual(expected, actual); }
public void Between10and20test(int a, int b, bool expected) { Conditionals test = new Conditionals(); bool actual = test.Between10and20(a, b); Assert.AreEqual(expected, actual); }
public void BackAroundTest(string str, string expected) { Conditionals test = new Conditionals(); string actual = test.BackAround(str); Assert.AreEqual(expected, actual); }
public void multiple3or5test(int number, bool expected) { Conditionals test = new Conditionals(); bool actual = test.Multiple3or5(number); Assert.AreEqual(expected, actual); }
public void front3test(string str, string expected) { Conditionals test = new Conditionals(); string actual = test.Front3(str); Assert.AreEqual(expected, actual); }
public void MissingChar(string str, int n, string expected) { Conditionals test = new Conditionals(); string actual = test.MissingChar(str, n); Assert.AreEqual(expected, actual); }
public void NotStringtest(string s, string expected) { Conditionals test = new Conditionals(); string actual = test.NotString(s); Assert.AreEqual(expected, actual); }
public void EndUpTest(string str, string expected) { Conditionals test = new Conditionals(); string actual = test.EndUp(str); Assert.AreEqual(expected, actual); }
public void HasTeenTest(int a, int b, int c, bool expected) { Conditionals test = new Conditionals(); bool actual = test.HasTeen(a, b, c); Assert.AreEqual(expected, actual); }
private void ScanChunk() { _chunkFiles = new HashSet <string>(StringComparer.InvariantCultureIgnoreCase); foreach (string file in _archive.AllFileNames()) { string[] parts = file.Split('\\'); if (parts.Length > 2) { if (ExtraFolders.Contains(parts[0]) || Conditionals.Any(cf => cf.Folder.Equals(parts[0], StringComparison.InvariantCultureIgnoreCase))) { parts = parts.Skip(1).ToArray(); } else { continue; } } if (parts.Length < 2) { continue; } int chunk = parts[1].IndexOf(".chunk.", StringComparison.InvariantCultureIgnoreCase); if (chunk > 0) { _chunkFiles.Add(parts[0] + "\\" + parts[1].Substring(0, chunk)); } } System.Diagnostics.Debug.WriteLine(" Finished scan for chunks, found " + String.Join(",", _chunkFiles)); }
public void SoAloneTest(int a, int b, bool expected) { Conditionals test = new Conditionals(); bool actual = test.SoAlone(a, b); Assert.AreEqual(expected, actual); }
public void Makes10(int a, int b, bool expected) { Conditionals test = new Conditionals(); bool actual = test.Makes10(a, b); Assert.AreEqual(expected, actual); }
public void removeDelTest(string str, string expected) { Conditionals test = new Conditionals(); string actual = test.RemoveDel(str); Assert.AreEqual(expected, actual); }
public bool IsNextToCube(Vector3 direction) { conditional = Conditionals.NextToCube; variable1 = direction; moveEvent.WaitOne(); return(result); }
public void ParrotTroubletest(bool isTalking, int hour, bool expected) { Conditionals test = new Conditionals(); bool actual = test.ParrotTrouble(isTalking, hour); Assert.AreEqual(expected, actual); }
public override string ToString() { var list = Conditionals.Select(con => con.Select(c => c.ToConditionalString()).JoinToString(" and ")); var checkString = $"Check on '{typeof (T).FullName}': " + Environment.NewLine + string.Join(Environment.NewLine, list.Select((l, i) => $"{i + 1}: {l}")); return(checkString); }
public static ExistsNode <T, TProperty> Exists <T, TProperty>(this RuntimeConfigurator configurator) where T : class where TProperty : class, IEnumerable { TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>(); return(configurator.CreateNode(id => new ExistsNode <T, TProperty>(id, tokenValue))); }
/// <summary> /// Checks if the conditionals to use this NPCChatDialogItemBase pass for the given <paramref name="user"/> /// and <paramref name="npc"/>. /// </summary> /// <param name="user">The user.</param> /// <param name="npc">The NPC.</param> /// <returns>True if the conditionals to use this NPCChatDialogItemBase pass for the given <paramref name="user"/> /// and <paramref name="npc"/>; otherwise false.</returns> public bool CheckConditionals(object user, object npc) { var c = Conditionals; if (c == null) return true; return Conditionals.Evaluate(user, npc); }
public static NotNullNode <T, TProperty> NotNull <T, TProperty>(this RuntimeConfigurator configurator) where T : class where TProperty : class { TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>(); return(configurator.CreateNode(id => new NotNullNode <T, TProperty>(id, tokenValue))); }
public void SetLang(Conditionals con) { con.Text = GlobalLang[CurrentLanguage].Entries[92]; con.fileToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[93]; con.openToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[94]; con.saveToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[95]; //95 con.mapToSVGToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[96]; con.editToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[97]; }
public static EachNode <T, TProperty, TElement> Each <T, TProperty, TElement>( this RuntimeConfigurator configurator, Action <TProperty, Action <TElement, int> > elementMatch) where T : class where TProperty : class, IEnumerable { TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>(); return(configurator.CreateNode(id => new EachNode <T, TProperty, TElement>(id, tokenValue, elementMatch))); }
public void SetLang(Conditionals con) { con.Text = GlobalLang[CurrentLanguage].Entries[92]; con.fileToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[93]; con.openToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[94]; con.saveToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[95]; //95 con.mapToSVGToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[96]; con.editToolStripMenuItem.Text = GlobalLang[CurrentLanguage].Entries[97]; }
// Update is called once per frame public override void Update() { if (thread.ThreadState == ThreadState.Unstarted && Input.GetKeyDown( KeyCode.Space)){ thread.Start(); } if (thread.ThreadState == ThreadState.WaitSleepJoin) { if (moveToVector != Vector3.zero) { MoveTo (moveToVector); moveToVector = Vector3.zero; } if (conditional != Conditionals.None) { switch (conditional) { case Conditionals.NextToCube: result = isNextToCube (variable1); break; case Conditionals.PositionAvailable: result = isAvailable (variable1); break; case Conditionals.PressingSensor: result = isPressingSensor (); break; case Conditionals.GameOver: result = isGameOver(); break; } conditional = Conditionals.None; moveEvent.Set (); } } }
public void CreateDefaultLang() { Language l = new Language(); Form1 f1 = new Form1(); Form2 f2 = new Form2(); DLCExplorer dlc = new DLCExplorer(); TOCeditor toc = new TOCeditor(); Conditionals con = new Conditionals(); Language_Selector lng = new Language_Selector(); AFCExtract afc = new AFCExtract(); BIKExtract bik = new BIKExtract(); PropertyManager prop = new PropertyManager(); XBoxConverter xbox = new XBoxConverter(); Language_Editor lne = new Language_Editor(); string[] t = new string[0]; MainWindow tlk = new MainWindow(); l.name = "Default"; l.Entries = new List<string>(); #region Form1 l.Entries.Add(f1.userToolsToolStripMenuItem.Text); //0 l.Entries.Add(f1.dLCEditorToolStripMenuItem.Text); l.Entries.Add(f1.tLKEditorToolStripMenuItem.Text); l.Entries.Add(f1.tOCbinEditorToolStripMenuItem.Text); //5 l.Entries.Add(f1.decompressorToolStripMenuItem.Text); l.Entries.Add(f1.conditionalsToolStripMenuItem.Text); l.Entries.Add(f1.lanugageSelectorToolStripMenuItem.Text); //l.Entries.Add("Extractor"); // KFreon: Not sure what all this is for exactly, so just filling in bits l.Entries.Add(f1.aFCToWAVToolStripMenuItem.Text); //10 l.Entries.Add(f1.moviestfcToBIKToolStripMenuItem.Text); l.Entries.Add(f1.propertyManagerToolStripMenuItem.Text); //l.Entries.Add(f1.xBoxConverterToolStripMenuItem.Text); l.Entries.Add(f1.optionsToolStripMenuItem.Text); l.Entries.Add(f1.selectToolLanguageToolStripMenuItem.Text); //15 #endregion #region Form2 l.Entries.Add(f2.Text); l.Entries.Add(f2.fileOpenToolStripMenuItem.Text); #endregion #region DLC Explorer l.Entries.Add(dlc.Text); //60 l.Entries.Add(dlc.groupBoxSfar.Text); l.Entries.Add(dlc.labelNumOfFiles.Text); l.Entries.Add(dlc.labelTotalUncSize.Text); l.Entries.Add(dlc.labelTotalUncBytes.Text); l.Entries.Add(dlc.labelTotalComprSize.Text); //65 l.Entries.Add(dlc.labelTotalComprBytes.Text); l.Entries.Add(dlc.labelComprRatio.Text); l.Entries.Add(dlc.labelFirstEntryOffset.Text); l.Entries.Add(dlc.labelFirstBlockOffset.Text); l.Entries.Add(dlc.labelFirstDataOffset.Text); //70 l.Entries.Add(dlc.groupBoxFile.Text); l.Entries.Add(dlc.labelFullName.Text); l.Entries.Add(dlc.labelHash.Text); l.Entries.Add(dlc.labelFileSize.Text); l.Entries.Add(dlc.labelUncSizeBytes.Text); //75 l.Entries.Add(dlc.labelComprSize.Text); l.Entries.Add(dlc.labelComprSizeBytes.Text); l.Entries.Add(dlc.labelEntry.Text); l.Entries.Add(dlc.labelBlockIndex.Text); l.Entries.Add(dlc.labelDataOffset.Text); //80 l.Entries.Add(dlc.toolStripOpenFile.Text); l.Entries.Add(dlc.toolStripSaveFile.Text); l.Entries.Add(dlc.toolStripInfo.Text); l.Entries.Add(dlc.toolStripAbout.Text); #endregion #region TOC Editor l.Entries.Add(toc.Text); //85 l.Entries.Add(toc.fileToolStripMenuItem.Text); l.Entries.Add(toc.openToolStripMenuItem.Text); l.Entries.Add(toc.saveToolStripMenuItem.Text); l.Entries.Add(toc.searchToolStripMenuItem.Text); l.Entries.Add(toc.searchAgainToolStripMenuItem.Text); //90 l.Entries.Add(toc.editFilesizeToolStripMenuItem.Text); #endregion #region Conditionals l.Entries.Add(con.Text); l.Entries.Add(con.fileToolStripMenuItem.Text); l.Entries.Add(con.openToolStripMenuItem.Text); l.Entries.Add(con.saveToolStripMenuItem.Text); //95 l.Entries.Add(con.mapToSVGToolStripMenuItem.Text); l.Entries.Add(con.editToolStripMenuItem.Text); #endregion #region Language Select l.Entries.Add(lng.Text); l.Entries.Add(lng.radioButton1.Text); l.Entries.Add(lng.radioButton2.Text); //100 l.Entries.Add(lng.radioButton3.Text); l.Entries.Add(lng.radioButton4.Text); l.Entries.Add(lng.radioButton5.Text); l.Entries.Add(lng.radioButton6.Text); l.Entries.Add(lng.button1.Text); //105 l.Entries.Add(lng.button2.Text); #endregion #region AFC l.Entries.Add(afc.Text); l.Entries.Add(afc.fileToolStripMenuItem.Text); l.Entries.Add(afc.openToolStripMenuItem.Text); l.Entries.Add(afc.extractToolStripMenuItem.Text); //110 l.Entries.Add(afc.selectedToolStripMenuItem.Text); l.Entries.Add(afc.allToolStripMenuItem.Text); #endregion #region BIK l.Entries.Add(bik.Text); l.Entries.Add(bik.fileToolStripMenuItem.Text); l.Entries.Add(bik.openToolStripMenuItem.Text); //115 l.Entries.Add(bik.extractToolStripMenuItem.Text); l.Entries.Add(bik.selectedToolStripMenuItem.Text); l.Entries.Add(bik.allToolStripMenuItem.Text); #endregion #region PropertyMan l.Entries.Add(prop.Text); l.Entries.Add(prop.fileToolStripMenuItem.Text); //120 l.Entries.Add(prop.newToolStripMenuItem.Text); l.Entries.Add(prop.loadDefinitonsToolStripMenuItem.Text); l.Entries.Add(prop.saveDefinitionsToolStripMenuItem.Text); l.Entries.Add(prop.loadDefaultToolStripMenuItem.Text); l.Entries.Add(prop.saveAsDefaultToolStripMenuItem.Text); //125 l.Entries.Add(prop.importFromFileToolStripMenuItem.Text); l.Entries.Add(prop.actionToolStripMenuItem.Text); l.Entries.Add(prop.addClassToolStripMenuItem.Text); l.Entries.Add(prop.addPropertyToolStripMenuItem.Text); l.Entries.Add(prop.deleteClassToolStripMenuItem.Text); //130 l.Entries.Add(prop.deletePropertyToolStripMenuItem.Text); #endregion #region xboxconverter l.Entries.Add(xbox.Text); l.Entries.Add(xbox.fileToolStripMenuItem.Text); l.Entries.Add(xbox.xXXPCCToolStripMenuItem.Text); l.Entries.Add(xbox.pCCXXXToolStripMenuItem.Text); //135 #endregion #region Language Editor l.Entries.Add(lne.Text); l.Entries.Add(lne.fileToolStripMenuItem.Text); l.Entries.Add(lne.saveToolStripMenuItem.Text); l.Entries.Add(lne.editToolStripMenuItem.Text); l.Entries.Add(lne.copyLanguagToolStripMenuItem.Text); //140 l.Entries.Add(lne.deleteLanguageToolStripMenuItem.Text); l.Entries.Add(lne.renameLanguageToolStripMenuItem.Text); l.Entries.Add(lne.editEntryToolStripMenuItem.Text); l.Entries.Add(lne.setLanguageAsDefaultToolStripMenuItem.Text); #endregion GlobalLang.Add(l); }
public bool IsAvailable(Vector3 direction) { conditional = Conditionals.PositionAvailable; variable1 = direction; moveEvent.WaitOne (); return result; }
public bool IsGameOver() { conditional = Conditionals.GameOver; moveEvent.WaitOne(); return result; }
// Update is called once per frame public override void Update() { if (thread.ThreadState == ThreadState.Unstarted && Input.GetKeyDown( KeyCode.Space)){ thread.Start(); } if (thread.ThreadState == ThreadState.WaitSleepJoin) { if(moveToVector == Vector3.forward || moveToVector == Vector3.back || moveToVector == Vector3.right || moveToVector == Vector3.left){ if (moveToVector != Vector3.zero && ((CubeHelper.IsFree(new Vector3Int(transform.position+moveToVector))&& !jump) || (!CubeHelper.IsFree(new Vector3Int(transform.position+moveToVector)) && jump))) { MoveTo (moveToVector); moveToVector = Vector3.zero; } } if (conditional != Conditionals.None) { switch (conditional) { case Conditionals.NextToCube: result = isNextToCube (variable1); break; case Conditionals.PositionAvailable: result = isAvailable (variable1); break; case Conditionals.PressingSensor: result = isPressingSensor (); break; case Conditionals.GameOver: result = isGameOver(); break; } conditional = Conditionals.None; moveEvent.Set (); } } }
// Use this for initialization public override void Start() { moveToVector = Vector3.zero; conditional = Conditionals.None; moveEvent = new AutoResetEvent (false); cc = this.gameObject.GetComponent<CubeControllerInput> (); id = 0; base.Start (); IsSelected = true; thread = new Thread (new ThreadStart (this.StartCube)); //thread.Start (); }
public bool IsPressingSensor() { conditional = Conditionals.PressingSensor; moveEvent.WaitOne (); return result; }
public bool IsNextToCube(Vector3 direction) { conditional = Conditionals.NextToCube; variable1 = direction; moveEvent.WaitOne (); return result; }