/// <summary> /// This is called in initialization and gets us all of the information from the dat file about this quest. /// </summary> /// <returns>Contract - this class has all of the information from the dat file about the quest.</returns> public DatLoader.Entity.Contract GetContractDetails() { DatLoader.Entity.Contract contractData; ContractTable contractTable = ContractTable.ReadFromDat(); return(contractTable.Contracts.TryGetValue(ContractId, out contractData) ? contractData : null); }
private static void PlayGame() { //List<SimpleComputerPlayer> players = new List<SimpleComputerPlayer>(); var threads = new List <Thread>(); Table table = new ContractTable(); for (int i = 0; i < Table.Seats.Length - 1; i++) //foreach (Seat seat in Table.Seats) { //seat is not used //(new ConsolePlayer(Console.In, Console.Out)).JoinTable(table); var p = new SimpleComputerPlayer(); p.JoinTable(table); threads.Add(p.Start()); } var ph = new ConsolePlayer(System.Console.In, System.Console.Out); ph.JoinTable(table); table.StartSession(); foreach (var t in threads) { t.Join(); } }
private static void PlayGame() { //List<SimpleComputerPlayer> players = new List<SimpleComputerPlayer>(); var threads = new List<Thread>(); Table table = new ContractTable(); for (int i = 0; i < Table.Seats.Length-1; i++) //foreach (Seat seat in Table.Seats) { //seat is not used //(new ConsolePlayer(Console.In, Console.Out)).JoinTable(table); var p = new SimpleComputerPlayer(); p.JoinTable(table); threads.Add(p.Start()); } var ph = new ConsolePlayer(System.Console.In, System.Console.Out); ph.JoinTable(table); table.StartSession(); foreach (var t in threads) t.Join(); }
private void POST_ClientsRemove() { ContractTable.DeleteContract(ClientID, UserAgent.Account.CompanyId.Value); }
private void POST_ContractorsRemove() { ContractTable.DeleteContract(UserAgent.Account.CompanyId.Value, ContractorID); }
private void POST_ContractorsAdd() { ContractTable.CreateContract(UserAgent.Account.CompanyId.Value, ContractorID); }
/// <summary> /// Adds the contracting string into the collation table. /// </summary> private void AddContractOrder(String groupChars, int anOrder, bool fwd) { if (ContractTable == null) { ContractTable = new List <>(INITIALTABLESIZE); } //initial character int ch = groupChars.CodePointAt(0); /* * char ch0 = groupChars.charAt(0); * int ch = Character.isHighSurrogate(ch0)? * Character.toCodePoint(ch0, groupChars.charAt(1)):ch0; */ // See if the initial character of the string already has a contract table. int entry = Mapping.elementAt(ch); List <EntryPair> entryTable = GetContractValuesImpl(entry - RBCollationTables.CONTRACTCHARINDEX); if (entryTable == null) { // We need to create a new table of contract entries for this base char int tableIndex = RBCollationTables.CONTRACTCHARINDEX + ContractTable.Count; entryTable = new List <>(INITIALTABLESIZE); ContractTable.Add(entryTable); // Add the initial character's current ordering first. then // update its mapping to point to this contract table entryTable.Add(new EntryPair(groupChars.Substring(0, Character.CharCount(ch)), entry)); Mapping.setElementAt(ch, tableIndex); } // Now add (or replace) this string in the table int index = RBCollationTables.GetEntry(entryTable, groupChars, fwd); if (index != RBCollationTables.UNMAPPED) { EntryPair pair = entryTable[index]; pair.Value = anOrder; } else { EntryPair pair = entryTable[entryTable.Count - 1]; // NOTE: This little bit of logic is here to speed CollationElementIterator // .nextContractChar(). This code ensures that the longest sequence in // this list is always the _last_ one in the list. This keeps // nextContractChar() from having to search the entire list for the longest // sequence. if (groupChars.Length() > pair.EntryName.Length()) { entryTable.Add(new EntryPair(groupChars, anOrder, fwd)); } else { entryTable.Insert(entryTable.Count - 1, new EntryPair(groupChars, anOrder, fwd)); } } // If this was a forward mapping for a contracting string, also add a // reverse mapping for it, so that CollationElementIterator.previous // can work right if (fwd && groupChars.Length() > 1) { AddContractFlags(groupChars); AddContractOrder((new StringBuffer(groupChars)).Reverse().ToString(), anOrder, false); } }