private List <string> GetAliasIdentityNames() { var identityNames = new List <string>(); var query = @"<AML>" + "<Item action='get' type='Identity' select='keyed_name'>" + "<and>" + "<is_alias condition='eq'>1</is_alias>" + "<classification condition='is null' />" + "</and>" + "</Item>" + "</AML>"; var itmsAML = Inn.applyAML(query); if (itmsAML != null) { var count = itmsAML.getItemCount(); for (var i = 0; i < count; i++) { var itm = itmsAML.getItemByIndex(i); var name = itm.getProperty("keyed_name"); identityNames.Add(name); } identityNames.Sort(); } return(identityNames); }
private List <string> GetListRoleNames() { var roleNames = new List <string>(); var query = @"<AML>" + "<Item action='get' type='List' select='name'>" + "<keyed_name condition='eq'>Project Role</keyed_name>" + "<Relationships>" + "<Item action='get' type='Value' select='value' orderBy='value'>" + "</Item>" + "</Relationships>" + "</Item>" + "</AML>"; var itmsAML = Inn.applyAML(query); if (itmsAML != null) { var count = itmsAML.getItemCount(); if (1 == count) { var rels = itmsAML.getRelationships(); for (var x = 0; x < rels.getItemCount(); x++) { var z = rels.getItemByIndex(x); var name = z.getProperty("value"); roleNames.Add(name); } roleNames.Sort(); } } return(roleNames); }
private KeyValuePair <string, string> GetMajorVersionAndServicPack() { string servicePack = "N/A"; string majorVersion = "N/A"; string amlQuery = @"<AML> <Item action='get' type='Variable' select='name,value'> <or> <name>VersionMajor</name> <name>VersionServicePack</name> </or> </Item></AML>"; Item result = Inn.applyAML(amlQuery); if (!result.isError()) { for (int i = 0; i < result.getItemCount(); i++) { Item item = result.getItemByIndex(i); if (item.getProperty("name") == "VersionMajor") { majorVersion = item.getProperty("value", string.Empty); } if (item.getProperty("name") == "VersionServicePack") { servicePack = item.getProperty("value", string.Empty); } } } return(new KeyValuePair <string, string>(majorVersion, servicePack)); }
public static Building Load(BinaryReader reader) { BuildingType type = (BuildingType)reader.ReadInt32(); TriDirection entDir = (TriDirection)reader.ReadInt32(); bool underconstruct = reader.ReadBoolean(); bool working = reader.ReadBoolean(); float constructTime = reader.ReadSingle(); Building ret = null; switch (type) { case BuildingType.INN: ret = Inn.Load(reader); break; case BuildingType.COMPANY: ret = Company.Load(reader); break; case BuildingType.WORKSITE: ret = Worksite.Load(reader); break; } ret.entranceDirection = entDir; ret.type = type; ret.UnderConstruct = underconstruct; ret.Working = working; ret.ConstructTime = constructTime; return(ret); }
public override Task <Outt> Send(Inn inn, ServerCallContext context) { return(Task.FromResult(new Outt { Message = "Hello " + inn.Name })); }
public User CreateUser() { var user = new User { UserName = Account != null?Account.Trim() : Inn.Trim(), FirstName = FirstName?.Trim(), MiddleName = MiddleName?.Trim(), SecondName = SecondName?.Trim(), Position = Position?.Trim(), Inn = Inn.Trim(), Birthdate = Birthdate, Address = Address?.Trim(), PhoneNumber = PhoneNumber?.Trim(), Email = Email?.Trim(), IsActive = IsActive, IsDeleted = IsDeleted, UserRoles = new List <UserRole>(), //todo: Password PasswordHash = Inn }; if (Role != null) { user.UserRoles.Add(Role.ToUserRole()); } return(user); }
void Start() { Tile t = WorldController.Instance.GetTileAt((int)this.transform.position.x, (int)this.transform.position.y); inn = new Inn(t, 6); GenerateGameObjects(); }
void Awake() { _delta = 0.1f; objects = new Dictionary <String, EObject>(); durations = new Dictionary <string, float>(); durations["pickup"] = 0.5f; durations["drop"] = 0.5f; agents [0] = Agent.Create(agent, new Vector3(20, 23, 1), this, "", "agent1", 1000); agents [1] = Agent.Create(agent, new Vector3(30, 10, 1), this, "", "agent2", 1000); agents [2] = Agent.Create(agent, new Vector3(10, 30, 1), this, "", "agent3", 1000); agents [3] = Agent.Create(agent, new Vector3(22, 2, 1), this, "", "agent4", 1000); agents [4] = Agent.Create(agent, new Vector3(13, 10, 1), this, "", "agent5", 1000); agents [5] = Agent.Create(agent, new Vector3(14, 30, 1), this, "", "agent6", 1000); // coins["gold1"] = Gold.Create (gold, new Vector3(6, 0, 15), this, "", "gold1", 2); // coins["gold2"] = Gold.Create (gold, new Vector3(22, 0, 4 ), this, "", "gold2", 2); // coins["gold3"] = Gold.Create (gold, new Vector3(27, 0, 15), this, "", "gold3", 2); // coins["gold4"] = Gold.Create (gold, new Vector3(2, 0, 4 ), this, "", "gold4", 2); // coins["gold5"] = Gold.Create (gold, new Vector3(5, 0, 22), this, "", "gold5", 2); // coins["gold6"] = Gold.Create (gold, new Vector3(26, 0, 10), this, "", "gold6", 2); // coins["gold7"] = Gold.Create (gold, new Vector3(12, 0, 18), this, "", "gold7", 2); // coins["gold8"] = Gold.Create (gold, new Vector3(12, 0, 18), this, "", "gold8", 2); // coins["gold9"] = Gold.Create (gold, new Vector3(26, 0, 6 ), this, "", "gold9", 2); // coins["gold10"] = Gold.Create (gold, new Vector3(11, 0, 4 ), this, "", "gold10", 2); inn = GameObject.FindWithTag("inn").GetComponent <Inn>(); }
public async Task Should_load_accounts_list() { var firstInn = LegalEntityInn.Parse("1754462785"); var firstKpp = Kpp.Parse("515744582"); var secondInn = LegalEntityInn.Parse("5616395700"); var secondKpp = Kpp.Parse("515744444"); var orgName = "org"; await using var accountScope1 = await Context.Accounts.CreateAccount(firstInn, firstKpp, orgName).ConfigureAwait(false); await using var accountScope2 = await Context.Accounts.CreateAccount(Inn.Parse("678050110389"), orgName).ConfigureAwait(false); await using var accountScope3 = await Context.Accounts.CreateAccount(secondInn, secondKpp, orgName).ConfigureAwait(false); await Task.Delay(1.Seconds()); var accountsAfterCreate = await Context.Accounts.LoadAllAccountsAsync(); accountsAfterCreate.Count.Should().Be(3); accountsAfterCreate.Should().ContainEquivalentOf(accountScope1.Entity); accountsAfterCreate.Should().ContainEquivalentOf(accountScope2.Entity); accountsAfterCreate.Should().ContainEquivalentOf(accountScope3.Entity); }
public override void DoRun() { var mfParser = new ManifestParser(_filePath, _env); foreach (AMLFile amlFile in mfParser.AMLFilesToExecute) { foreach (string aml in amlFile.AMLs) { Log.Log(aml); Item result = Inn.applyAML(aml); if (result.isError()) { Log.LogError($"{result.getErrorString()}"); if (amlFile.StopOnError) { Log.LogError("Stopping Executtion"); return; } } else { Log.LogSuccess("OK"); } } } }
public IActionResult Post([FromBody] Inn inn) { if (obService.SearchInObList(inn.inn)) { return(Ok(inn)); } return(BadRequest(inn)); }
public void Should_apply_inn_filter() { var docflowFilter = new DocflowFilterBuilder() .WithInnKppOfALegalEntity(InnKpp.Parse("1234567890-123456789")) .WithIndividualEntrepreneurInn(Inn.Parse("123456789012")) .CreateFilter(); ShouldHaveExpectedQueryParameters(docflowFilter, ("innKpp", "123456789012")); }
protected string RetrieveProperty(string propertyName) { string amlQuery = string.Format("<AML><Item action='get' type='{0}' id='{1}' select='{2}'></Item></AML>" , this.GetArasType(), this.GetId(), propertyName); Item item = Inn.applyAML(amlQuery); string value = item.getProperty(propertyName); return(value); }
public static void Start() { Console.Title = "Fantasy RPG"; List <Merchant> equipment = Armor.StarterArmor(); List <Merchant> weapon = Weapons.AddWeapon(); List <Merchant> armor = Armor.AddArmor(); List <Merchant> items = Items.AddItems(); List <Merchant> food = Inn.AddFood(); Hero hero = CreateHero(equipment, armor); bool activeGame = false; do { Console.WriteLine("\n**************************************\n" + "* 1. Go Adventuring\n" + "* 2. Show details about your character\n" + "* 3. Rest at the Inn\n" + "* 4. Visit shop\n" + "* 5. Exit\n" + "**************************************\n"); Console.Write(">> "); Console.ForegroundColor = ConsoleColor.Cyan; string menuChoice = Console.ReadLine(); Console.ResetColor(); switch (menuChoice) { case "1": // hero enters battle phase , returns boolean which if player dies ends game activeGame = HeroMethods.Battle(hero); break; case "2": //prints Hero stats and current equipment from ToString in Hero Console.WriteLine(hero); break; case "3": //Allows hero to rest at in exchange for gold, this heals the player to full health Inn.VisitInn(hero, food); break; case "4": //Enters shop, where all equipment is located, when purchased items are auto equipped. Merchant.ItemShop(hero, items, armor, weapon, equipment); break; case "5": // quits game activeGame = true; break; } if (hero.lvl >= 10) { Console.WriteLine("You are a true hero! You win!"); activeGame = true; } } while (!activeGame); }
public static DraftPayer IndividualEntrepreneur(Inn inn) { if (inn is null) { throw new ArgumentNullException(nameof(inn)); } var innString = inn.ToString() ?? throw new ArgumentNullException(nameof(inn)); return(new(innString, null)); }
public async Task Should_create_a_new_individual_entrepreneur_account_and_read_it() { await using var accountScope = await Context.Accounts.CreateAccount(Inn.Parse("678050110389"), "org"); var account = accountScope.Entity; await Task.Delay(1.Seconds()); var loadedAccount = await Context.Accounts.GetAccount(account.Id); loadedAccount.Should().BeEquivalentTo(account); }
public override void DoRun() { Log.Log("Url: " + Inn.getConnection().MapClientUrl("../../") + " DB: " + Inn.getConnection().Database); PrintReleaseAndServicePack(); Log.Log(String.Empty); PrintLatestDatabaseUpgrade(); Log.Log(String.Empty); PrintLatestModifiedAdminType(); Log.Log(String.Empty); PrintLastLoggedInUser(); }
private void CreateInnInformationScreen(Inn inn) { SetWindow(inn.Name, 708, 388); SetIcon("Inn"); CreateLabel(inn.Name, false, new Point(37, 28), new Size(343, 39), 14, false, true); CreatePictureBox(inn.Name, new Point(143, 100), new Size(125, 125)); CreateLabel(inn.Description, false, new Point(37, 257), new Size(343, 63), 11); CreateLabel("Info", false, new Point(380, 34), new Size(284, 43), 11, true); CreateIconValueCombo("Gold", "Gold to stay a night:", inn.GoldCost.ToString(), 412, 100); }
public IActionResult Add([FromBody] Inn inn) { if (obService.SearchInObList(inn.inn)) { return(BadRequest(inn)); } else { obService.AddInnToObList(inn.inn); return(Ok(inn)); } }
public static DraftSender IndividualEntrepreneur(Inn inn, CertificateContent certificate) { if (inn is null) { throw new ArgumentNullException(nameof(inn)); } if (certificate is null) { throw new ArgumentNullException(nameof(certificate)); } return(new(inn.ToString(), null, certificate)); }
public void GeneratePerson() { Inn t = target as Inn; if (!t) { Debug.LogError("Invalid building command"); return; } Person worker = t.GetCommandReceiver() as Person; worker.Work = t; }
public void MovePlayer_WhenLandingInInn_PlayerIsLoosingTurn() { ISquare square = new Inn(-2); int diceAmount = -1; player = players[0]; player.TurnsToStayStill = 0; gameboard.MovePlayer(player, diceAmount, square); Assert.AreEqual(1, player.TurnsToStayStill); }
public static void Enter(Player player) { Interface.BasicInterfaceDelegate(player, LineHelpers.PrintLineWithContinue, "The town is vibrant and people are walking around and trading freely but you sense an air of worry."); while (true) { // A simple switch to check what the player wants to do. this could and probably should be just a while loop Interface.BasicInterfaceDelegateParams(player, LineHelpers.PrintLine, "Town:", "1. Head West", "2. Enter Inn", "3. Enter Shop.", "4. Check Notice Board", "5. Character Sheet", "6. View Inventory", "7. Save and Quit Game"); int type = LineHelpers.ReadInputNumber(new int[] { 1, 2, 3, 4, 5, 6, 7 }); Interface.BasicInterface(player); // This is like the game hub and the player can only save here. switch (type) { case 1: Dungeon.Enter(player); break; case 2: Inn.Enter(player); break; case 3: Shop.Enter(player); break; case 4: NoticeBoard.Check(player); break; case 5: Sheets.Character(player); break; case 6: player.ViewInventory(); break; default: if (Game.Save(player)) { return; } break; } } }
public new static Inn Load(BinaryReader reader) { InnType subType = (InnType)reader.ReadInt32(); Inn ret = null; switch (subType) { case InnType.TENT: ret = Tent.Load(reader); break; } ret.subType = subType; return(ret); }
public override void DoRun() { Log.Log($"Executing {Name}"); Item result = Inn.applyAML(GetMetaAml()); Log.Log($"Meta data count: {result.getItemCount()}"); LoadPackageMap(Inn); Log.Log($"Package Elements total count: {_packageMap.Count}"); int itemsCount = 0; int unpackagedItemsCount = 0; int itemsAddedToPackageCount = 0; for (int i = 0; i < result.getItemCount(); i++) { Item item = result.getItemByIndex(i); string keyedName = item.getPropertyAttribute("id", "keyed_name"); if (keyedName.StartsWith(Prefix, StringComparison.OrdinalIgnoreCase)) { itemsCount++; if (!CheckIfInPackage(item)) { Log.Log($"Not in any package: {item.getType()} named {keyedName}"); unpackagedItemsCount++; var pkgMgr = new Hille.Aras.DevTool.Common.Commands.Aras.PackageManagment.PackageManager(Inn) { DryRun = DryRun, AutoPack = AutoPack }; ((ILoggable)pkgMgr).Logger = Log; Item packageElement = pkgMgr.FindAndAddSuitablePackageForItem(item); if (!packageElement.isError()) { string packageDefName = pkgMgr.GetPackageDefinitionNameFromPackageElement(packageElement); Log.LogSuccess($"Added to package {packageDefName} as {packageElement.getProperty("element_type")} "); itemsAddedToPackageCount++; } else { Log.LogWarning("Could not find a suitable package"); } } } } Log.Log($"Items checked: {itemsCount}"); Log.Log($"Items not in any package: {unpackagedItemsCount}"); Log.Log($"Items added to package: {itemsAddedToPackageCount}"); }
private void checkInsideBuilding() { SimulationState ss; ss = (GameObject.FindGameObjectWithTag("GameController"). GetComponent(typeof(SimulationEngineComponentScript)) as SimulationEngineComponentScript).engine as SimulationState; //ss.stdout.Send("Inns: "+ss.inns.Values.ToString()); int currentNode = (AstarPath.active.GetNearest(this.transform.position).node as GridNode).GetIndex(); if (SimulationState.getInstance().nodeToInn.ContainsKey(currentNode)) { Inn inn = SimulationState.getInstance().nodeToInn[currentNode]; inn.heal(this); } }
public List <DatabaseUpgrade> GetDatabaseUpgrades() { var databaseUpgrades = new List <DatabaseUpgrade>(); string aml = @"<AML> <Item action='get' type='DatabaseUpgrade' select='applied_on,name,target_release,is_latest,description' orderBy='applied_on DESC'> </Item></AML>"; string latestUpdatedDate = String.Empty; Item dbUpgradeItems = Inn.applyAML(aml); int i = 0; bool allUpdatesFromLatestDay = false; while (!allUpdatesFromLatestDay && (i < dbUpgradeItems.getItemCount())) { Item dbUpgrade = dbUpgradeItems.getItemByIndex(i); string appliedDate = dbUpgrade.getProperty("applied_on", String.Empty); if (appliedDate != String.Empty) { appliedDate = appliedDate.Substring(0, 10); } if (latestUpdatedDate == String.Empty && appliedDate != String.Empty) { latestUpdatedDate = appliedDate.Substring(0, 10); } if (appliedDate == latestUpdatedDate) { var databaseUpgrade = new DatabaseUpgrade { AppliedOn = dbUpgrade.getProperty("applied_on"), Name = dbUpgrade.getProperty("name"), TargetRelease = dbUpgrade.getProperty("target_release"), Description = dbUpgrade.getProperty("description"), IsLatest = (dbUpgrade.getProperty("is_latest") == "1") ? true : false }; databaseUpgrades.Add(databaseUpgrade); } i++; } return(databaseUpgrades); }
public void UpdateUser(User user) { user.UserName = user.UserName != null?user.UserName.Trim() : Inn.Trim(); user.FirstName = FirstName?.Trim(); user.MiddleName = MiddleName?.Trim(); user.SecondName = SecondName?.Trim(); user.Position = Position?.Trim(); user.Inn = Inn.Trim(); user.Birthdate = Birthdate; user.Address = Address?.Trim(); user.PhoneNumber = PhoneNumber?.Trim(); user.Email = Email?.Trim(); user.IsActive = IsActive; user.IsDeleted = IsDeleted; var userRole = user.UserRoles.FirstOrDefault(r => r.RoleId == Role.Id && r.IsDeleted == false); if (userRole != null) { return; } var activeUserRoles = user.UserRoles.Where(r => r.UserId == user.Id && r.IsDeleted == false); foreach (var activeUserRole in activeUserRoles) { activeUserRole.MarkAsDeleted(); } if (Role != null) { var newUserRole = Role.ToUserRole(); if (user.UserRoles == null) { user.UserRoles = new List <UserRole>(); } user.UserRoles.Add(newUserRole); } }
private string GetPackageName() { string amlQuery = $@"<AML> <Item action='get' type='PackageGroup' select='source_id'> <Relationships> <Item action='get' type='PackageElement' select='element_type,name'> <element_type>{this.GetArasType()}</element_type> <name>{this.GetKeyedName()}</name> </Item> </Relationships> </Item> </AML>"; Item result = Inn.applyAML(amlQuery); if (result.isError()) { return("N/A"); } return(result.getPropertyAttribute("source_id", "keyed_name")); }
/// <summary> /// Creates a new InnScreen object. /// </summary> public InnScreen(Inn inn) : base() { // check the parameter if (inn == null) { throw new ArgumentNullException("inn"); } this.IsPopup = true; this.inn = inn; welcomeMessage = Fonts.BreakTextIntoList(inn.WelcomeMessage, Fonts.DescriptionFont, maxWidth); serviceRenderedMessage = Fonts.BreakTextIntoList(inn.PaidMessage, Fonts.DescriptionFont, maxWidth); noGoldMessage = Fonts.BreakTextIntoList(inn.NotEnoughGoldMessage, Fonts.DescriptionFont, maxWidth); selectionMark = 1; ChangeDialogue(welcomeMessage); }
void Awake() { _delta = 0.1f; objects = new Dictionary <String, EObject>(); durations = new Dictionary<string, float>(); durations["pickup"] = 0.5f; durations["drop"] = 0.5f; agents [0] = Agent.Create(agent, new Vector3(20, 23, 1), this, "", "agent1", 1000); agents [1] = Agent.Create(agent, new Vector3(30, 10, 1), this, "", "agent2", 1000); agents [2] = Agent.Create(agent, new Vector3(10, 30, 1), this, "", "agent3", 1000); agents [3] = Agent.Create(agent, new Vector3(22, 2, 1), this, "", "agent4", 1000); agents [4] = Agent.Create(agent, new Vector3(13, 10, 1), this, "", "agent5", 1000); agents [5] = Agent.Create(agent, new Vector3(14, 30, 1), this, "", "agent6", 1000); // coins["gold1"] = Gold.Create (gold, new Vector3(6, 0, 15), this, "", "gold1", 2); // coins["gold2"] = Gold.Create (gold, new Vector3(22, 0, 4 ), this, "", "gold2", 2); // coins["gold3"] = Gold.Create (gold, new Vector3(27, 0, 15), this, "", "gold3", 2); // coins["gold4"] = Gold.Create (gold, new Vector3(2, 0, 4 ), this, "", "gold4", 2); // coins["gold5"] = Gold.Create (gold, new Vector3(5, 0, 22), this, "", "gold5", 2); // coins["gold6"] = Gold.Create (gold, new Vector3(26, 0, 10), this, "", "gold6", 2); // coins["gold7"] = Gold.Create (gold, new Vector3(12, 0, 18), this, "", "gold7", 2); // coins["gold8"] = Gold.Create (gold, new Vector3(12, 0, 18), this, "", "gold8", 2); // coins["gold9"] = Gold.Create (gold, new Vector3(26, 0, 6 ), this, "", "gold9", 2); // coins["gold10"] = Gold.Create (gold, new Vector3(11, 0, 4 ), this, "", "gold10", 2); inn = GameObject.FindWithTag ("inn").GetComponent<Inn>(); }
public void addInn(Inn inn) { inn._name = "inn" + inns.Count; inns[inn._name] = inn; nodeToInn[inn.getNode().GetIndex()] = inn; }