public LandCreature(Creature creature, Land land) : base(land) { this.creature = creature; creature.landCreature = this; encounterTrigger = new Encounter(this, land); }
public void StartGame() { if (state != LandManagerState.idle) throw new Exception("Trying to start a game twice."); state = LandManagerState.loading; land = new Land(14); //activeBox = new LandActiveBox(land, world, new Point(600, 600)); //landCamera = activeBox.camera; //LandCameraControl control = new LandCameraControl(land, landCamera); //HumanPlayer human = new HumanPlayer(land); //PlayerManager.getPlayer("player1").addControlable(human); //control.setAnchor(human); //land.addContentRequirer(human); //land.addUpdateNode(human); minimap = new MapPreviewer(this.world, land, new Vector2(400f, 400f)); minimap.position = UserInterfaceManager.getCurrentLowerLeftCorner() + UserInterfaceManager.getDiagonalOnWorld()/2f + new Vector2(0f,-20f); minimapLoopAnimation = new LoopingAnimation(world, minimap, minimap.position, minimap.position, minimap.rotation, minimap.rotation, new Vector2(395f,395f), new Vector2(400f,400f), 5f, LoopingAnimation.InterpolationType.Trignometric, true, 0f); //activeBox.position.X = UserInterfaceManager.getCurrentUpperLeftCorner().X + 200f + 300f; land.loadMap(); loadPreviewer = new LandLoadPreviewer(world, land); loadPreviewer.position = new Vector2(0f, 220f); }
public FightWorld(Land land, Vector2 landPosition, Creature humanFightCreature, Creature AIFightCreature) { this.land = land; this.landPosition = landPosition; humanFighter = humanFightCreature.createFightCreature(this); humanFighter.position.X = -300f; PlayerManager.getPlayer("player1").addControlable(humanFighter); AIFighter = AIFightCreature.createFightCreature(this); AIFighter.position.X = 300f; floorLevel = 0f; //ground Dummy dum = new Dummy(this, "whiteSquare"); dum.texture.filter = Color.Brown; dum.texture.size = new Vector2(1000f, 500f); dum.position.Y = 300f; //sky dum = new Dummy(this, "whiteSquare"); dum.texture.filter = Color.SkyBlue; dum.texture.size = new Vector2(1000f, 600f); dum.position.Y = -250f; }
private void cmdDictionary_Click(object sender, EventArgs e) { Dictionary<string, Land> dc = new Dictionary<string, Land>(); lstAnzeige1.Items.Clear(); dc["E"] = new Land("Spanien", "Madrid"); dc["CH"] = new Land("Schweiz", "Bern"); lstAnzeige1.Items.Add("Anzahl: " + dc.Count); ausgabeDictKeys("Schlüssel", dc); ausgabeDictValues("Werte", dc); ausgabeDict("Zu Beginn", dc); if (dc.ContainsKey("CH")) { lstAnzeige1.Items.Add("Enthält Schlüssel CH"); } if (dc.ContainsValue(new Land("Schweiz", "Bern"))) { lstAnzeige1.Items.Add("Enthält Wert Schweiz/Bern"); } dc["E"] = new Land("Ecuador", "Quito"); ausgabeDict("Nach Ersetzen über Schlüssel", dc); dc.Remove("E"); ausgabeDict("Nach Löschen über Schlüssel", dc); }
public Faction(Land land) { this.land = land; allies = new List<Faction>(); enemys = new List<Faction>(); agressiveTowardsNeutrals = false; allyTowardsNeutrals = false; }
public Town(Land land, int ID) : base(land) { this.ID = ID; texture = new DrawableTexture("whiteSquare", this); texture.filter = Color.Orange; texture.layer = 0.95f; label = new DrawableText(AssetManager.getAssetSpriteFont("townLabelFont"), this, "Town " + ID, Color.White); label.layer = 0.949f; }
public MapPreviewer(World world, Land land, Vector2 size) : base(world) { Texture2D textureBase = land.getMinimap(new Point((int)size.X,(int)size.Y)); AssetTexture text = new AssetTexture(textureBase, "minimapTexture"); minimap = new DrawableTexture(text, this); minimap.size = size; }
public LandActiveBox(Land land, World world, Point size) : base(world, new Camera(size.X - 10, size.Y - 10, land)) { border = new DrawableTexture("whiteSquare", this); border.size.X = size.X; border.size.Y = size.Y; border.filter = Color.Black; border.layer = 0.501f; texture.layer = 0.5f; }
public LandRat(Land land, int seed, Rat creature) : base(creature, land) { Random rdm = new Random(seed); texture = new DrawableTexture("whiteSquare", this); texture.size = new Vector2(10f, 10f); texture.filter = Color.Black; texture.rotation = (float)(rdm.NextDouble() * Math.PI * 2f); }
public WaterTile(Vector2 position, Vector2 size, Land land, int seed) : base(land) { this.position = position; this.seed = seed; this.size = size; textureLoaded = false; }
public LandLoadPreviewer(World world, Land loadingLand) : base(world) { this.loadingLand = loadingLand; AssetSpriteFont font = AssetManager.CreateAssetSpriteFont("landLoaderFont", "defaultFont"); statusText = new DrawableText(font, this, "", Color.White); statusBar = new DrawableTexture("whiteSquare", this); statusBar.size = new Vector2(20f, 10f); statusBar.position = new Vector2(0f, 30f); }
// checks for landing and sets jumping flags to false private void CheckIfLanded() { if (IsJumping && _canBasic) { Land?.Invoke(); if (_landRoutine == null) { StartCoroutine(LandRoutine()); } } IsJumping = false; IsFalling = false; }
// GET: Lands/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Land land = db.Lands.Find(id); if (land == null) { return(HttpNotFound()); } ViewBag.FireStationId = new SelectList(DataFilter.GetFireStations(TempData.Peek("Id") + ""), "Id", "Name", land.FireStationId); return(View(land)); }
public LandHumanPlayer(Land world, HumanPlayer human, GameManager gameManager) : base(world,human) { this.gameManager = gameManager; guy = new DrawableTexture("whiteSquare", this); guy.size.X = 10f; guy.size.Y = 10f; encounterTrigger.encounterHandlers += CreatureEncountered; physicalProperties = new LandPhysicalProperties(); physicalProperties.activelyColliding = true; physicalProperties.radius = 10f; physicalProperties.collisionType = LandCollisionTypes.Solid; }
public void DieAndGotoArea(string area) { MessageManager.AddMessage("The pirates throw you overboard and you drown."); Player.Instance.Die(); MessageManager.AddMessage("You wake up near the docks of Koya Hasa."); Area a = AreaManager.Instance.GetAreaByName(area); Land l = AreaManager.Instance.GetLandForArea(a); if (l != null && l != GameState.CurrentLand) { GameState.CurrentLand = l; } a.Unlock(); GameState.GoTo("World/" + a.AreaURL); }
public void EmitBullet(Vector3 initPos, Land toLand, Player player) { Emission entity = Instantiate(bulletPrefab, initPos, Quaternion.identity); entity.SetToWhere(toLand.transform.position); entity.SetPlayer(player); entity.SetSpeed(0.1f);// entity.OnArrive += (object sender, System.EventArgs e) => { if (toLand == null || toLand.GetPlayer().Equals(player)) { return; } toLand.Damage(10, player); }; }
public LandHumanPlayer(Land world, HumanPlayer human, GameManager gameManager) : base(world, human) { this.gameManager = gameManager; guy = new DrawableTexture("whiteSquare", this); guy.size.X = 10f; guy.size.Y = 10f; encounterTrigger.encounterHandlers += CreatureEncountered; physicalProperties = new LandPhysicalProperties(); physicalProperties.activelyColliding = true; physicalProperties.radius = 10f; physicalProperties.collisionType = LandCollisionTypes.Solid; }
/// <summary> /// Static function that reads Land data from specified file at current location. /// </summary> /// <param name="reader">Stream to read from.</param> /// <returns>Read data.</returns> public static Land ReadLand(BinaryReader reader) { if (reader == null) { throw new ArgumentNullException("reader"); } Land land = new Land(); land.Flags = (Flags)reader.ReadUInt32(); land.TextureID = reader.ReadUInt16(); land.NameBytes = reader.ReadBytes(20); return(land); }
protected void SpellTargeting() { if (arrow != null) { arrow.SetPositions(spellCaster.transform.position, CursorStalker.GameCursor.Target.transform.position); } if (CursorStalker.GameCursor.Target != CursorStalker.GameCursor.gameObject) { spellTarget = CursorStalker.GameCursor.Target.GetComponent <Land>(); } else { spellTarget = null; } }
/// <summary> /// Legt ein neues Land mit den übergebenen Daten in der Datenbank an. /// </summary> /// <param name="land">Daten des neuen Landes</param> /// <seealso cref="EasyAuftragContext"/> public void LandAnlegen(Land land, string connection) { try { using (var db = new EasyAuftragContext(connection)) { db.Laender.Add(land); db.SaveChanges(); } } catch (Exception ex) { ErrorHandler.ErrorHandle(ex); } }
private Land getLandFromWorld(List <Continent> world, string nameLand) { Land result = null; foreach (Continent continent in world) { Land landBuffer = null; landBuffer = continent.getLand(nameLand); if (landBuffer != null) { result = landBuffer; } } return(result); }
public override Case GetCase() { Case case_land = new Land(position, name, price, col); string line; // Read the file and display it line by line. string dir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName; System.IO.StreamReader file = new System.IO.StreamReader(dir + "/Monopoly_SELMI_TRAN_DINH/Monopoly_SELMI_TRAN_DINH/bin/Debug/Land&Station.txt"); line = file.ReadLine(); string[] words = line.Split(','); case_land = new Land(int.Parse(words[0]), words[1], int.Parse(words[2]), words[3]); file.Close(); return(case_land); }
// GET: Land/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Land land = db.Laender.Find(id); if (land == null) { return(HttpNotFound()); } ViewBag.HauptStadtId = new SelectList(db.Staedte, "Id", "Name", land.HauptStadtId); return(View(land)); }
public void StartFight(Creature playerCreature, Creature otherCreature, Land land, Vector2 position) { fightWorld = new FightWorld(land, position, playerCreature, otherCreature); this.playerCreature = playerCreature; this.enemyCreature = otherCreature; Rectangle rect = gameManager.getActiveBoxArea(); activeBox = new ActiveBox(gameManager.world, new Camera(rect.Width, rect.Height, fightWorld)); activeBox.position = UserInterfaceManager.getUserInterfaceArea("activebox").getCenter(); activeBox.texture.filter = Color.Transparent; fadeTime = 1f; fightState = FightState.starting; }
/* 场记接口方法的实现,主要完成场景载入 */ public void LoadResource() { startLand = new Land(true); endLand = new Land(false); boat = new Boat(); roles = new Role[6]; for (int i = 0; i < 3; i++) { roles[i] = new Role(true, "Priest" + i); } for (int i = 3; i < 6; i++) { roles[i] = new Role(false, "Devil" + i); } }
public void TestMakeHollow() { CreateLänder(); r.LandHinzufügen(de); pm.Save(); pm.MakeHollow(r); Assert.AreEqual(NDOObjectState.Hollow, r.NDOObjectState, "Wrong state #1"); Land l = (Land)r.Länder[0]; // Should be in Cache Assert.AreEqual(NDOObjectState.Persistent, l.NDOObjectState, "Wrong state #2"); Assert.AreEqual(de.Name, l.Name, "Name is wrong"); Assert.AreSame(de, l, "Land is wrong"); Assert.AreEqual(1, r.Länder.Count, "#1 Number of Länder"); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Land = await _context.Land.FirstOrDefaultAsync(m => m.LandId == id); if (Land == null) { return(NotFound()); } return(Page()); }
public static Tuple <Land, Enemy> GenerateLandAndEnemy() { int number = 0; var world = Data.World; Random RandomNumberGenerator = new Random(); number = RandomNumberGenerator.Next(0, world.Lands.Count); Land land = world.Lands[number]; number = RandomNumberGenerator.Next(0, land.Enemies.Count); Enemy enemy = land.Enemies[number]; return(new Tuple <Land, Enemy>(land, enemy)); }
/// <summary> /// The bank sell a hotel to the player /// </summary> /// <param name="p">Player</param> /// <param name="l">Land</param> public void SellHotel(Player p, Land l) { if (NbHotel > 0) { NbHotel--; l.AddHotel(); BankAccount bankAccount = GetBankAccount(); BankAccount playerAccount = GetBankAccount(p); playerAccount.BankTransfer(bankAccount, l.LandGroup.HotelPrice); } else { throw new Exception(); } }
public void Lands_with_same_positions_are_equals() { // arrange var posX = NewPos(); var posY = NewPos(); var land1 = new Land(_board, posX, posY); var land2 = new Land(_board, posX, posY); // act var equals = land1.Equals(land2); //assert equals.Should().BeTrue(); }
public void attack(Land attacker, Land defender, int nTankAttacker, int nTankDefender) { /* * simula un attacco con facendo tutti i controlli (attacker deve essere il currentplayer) * se defender rimane con 0 di tank far in modo che la land passi al player */ List <int> attackerDices = new List <int>(); List <int> defenderDices = new List <int>(); rollDices(attackerDices, nTankAttacker); rollDices(defenderDices, nTankDefender); checkResults(attackerDices, defenderDices, attacker, defender); }
public Encounter(LandCreature anchor, Land land) : base(land) { this.anchor = anchor; physicalProperties = new LandPhysicalProperties(); physicalProperties.activelyColliding = true; physicalProperties.collisionType = LandCollisionTypes.Static; physicalProperties.radius = encounterRadius; Dummy = new DrawableTexture("whiteCircle100x100", this); Dummy.size = new Vector2(100f, 100f); Dummy.filter = Color.Transparent; Dummy.layer = 0.98f; }
public void CropData() { string id; bool validate; string name; int count = 0; Console.WriteLine("Available lands:"); LandList.ForEach(l => { if (!l.Used) { Console.WriteLine(l.Id); count++; } }); if (count > 0) { Console.Write("Enter the land id: "); id = Console.ReadLine(); StringValidate.Value = id; validate = StringValidate.ValidateField(); Console.Write("Enter the name of the new crop: "); name = Console.ReadLine(); StringValidate.Value = name; validate = validate && StringValidate.ValidateField(); if (validate) { Land l = LandList.FirstOrDefault(p => p.Id == id && !p.Used); if (l != null) { Handler.NewCrop(l, name); } else { Console.WriteLine("No available lands match the entered id"); } } else { Console.WriteLine("The data input was invalid"); } } else { Console.WriteLine("No available lands"); } }
private void OutlineIsland(Land landToStart, char[,] grid, bool[,] visitedPlaces) { var queue = new Queue <Land>(); int maxY = grid.GetLength(0); int maxX = grid.GetLength(1); queue.Enqueue(landToStart); while (queue.TryDequeue(out Land land)) { int x = land.X; int y = land.Y; if (land.X + 1 < maxX) { x = land.X + 1; y = land.Y; ProcessLand(x, y, grid[y, x], queue, visitedPlaces); } if (land.X - 1 >= 0) { x = land.X - 1; y = land.Y; ProcessLand(x, y, grid[y, x], queue, visitedPlaces); } if (land.Y + 1 < maxY) { x = land.X; y = land.Y + 1; ProcessLand(x, y, grid[y, x], queue, visitedPlaces); } if (land.Y - 1 >= 0) { x = land.X; y = land.Y - 1; ProcessLand(x, y, grid[y, x], queue, visitedPlaces); } } }
public int GetTheRent(Property p, int dicesValue) { int rentValue = 0; if (p is Land) { Land l = (Land)p; if (CheckIfPlayerOwnAllLandInLandGroup(WhoOwnThisProperty(p), l.LandGroup)) { if (l.NbHouse == 0 && l.NbHotel == 0) { rentValue = 2 * l.GetRent(0); } else if (l.NbHouse <= Land.NB_MAX_HOUSES && l.NbHotel == 0) { rentValue = l.GetRent(l.NbHouse); } else if (l.NbHouse == 0 && l.NbHotel != 0) { rentValue = l.GetRent(Land.NB_MAX_HOUSES + l.NbHotel); } } else { rentValue = l.GetRent(l.NbHouse); } } else if (p is PublicService) { if (NumberOfPublicServiceOwned(p) == 1) { rentValue = 4 * dicesValue; } else if (NumberOfPublicServiceOwned(p) == CountTheNumberOfPublicSercices()) { rentValue = 10 * dicesValue; } } else if (p is TrainStation) { TrainStation t = (TrainStation)p; rentValue = t.TrainStationRent * NumberOfTrainStationOwned(p); } return(rentValue); }
public void Land_can_be_compared() { // arrange var posX = _faker.Random.Number(1, 4); var posY = _faker.Random.Number(1, 4); var landA = new Land(_board, posX, posY); var landB = new Land(_board, posX, posY); var landC = new Land(_board, posX, 0); var landD = new Land(_board, 0, posY); var landE = default(Land); // act var equalsAB_1 = landA.Equals(landB); var equalsAB_2 = landA == landB; var equalsAB_3 = landA.GetHashCode() == landB.GetHashCode(); var equalsBC_1 = landB.Equals(landC); var equalsBC_2 = landB == landC; var equalsCD_1 = landC.Equals(landD); var equalsCD_2 = landC == landD; var equalsDE_1 = landD.Equals(landE); var equalsDE_2 = landD == landE; var equalsA0_1 = landA == landE; var equalsA0_2 = landE == landA; var equals00_1 = landE == null; var equals00_2 = landD.Equals(DateTime.UtcNow); var equals00_3 = landA.Equals((object)DateTime.UtcNow); var equals00_4 = landA.Equals((object)landB); var equals00_5 = landA.Equals((object)null); // assert equalsAB_1.Should().BeTrue(); equalsAB_2.Should().BeTrue(); equalsAB_3.Should().BeTrue(); equalsBC_1.Should().BeFalse(); equalsBC_2.Should().BeFalse(); equalsCD_1.Should().BeFalse(); equalsCD_2.Should().BeFalse(); equalsDE_1.Should().BeFalse(); equalsDE_2.Should().BeFalse(); equalsA0_1.Should().BeFalse(); equalsA0_2.Should().BeFalse(); equals00_1.Should().BeTrue(); equals00_2.Should().BeFalse(); equals00_3.Should().BeFalse(); equals00_4.Should().BeTrue(); equals00_5.Should().BeFalse(); }
public TerrainTile(TerrainType type, Vector2 position, Vector2 size, Land land, int seed) : base(land) { this.position = position; this.land = land; this.seed = seed; terrainTexture = AssetManager.getAssetTexture("whiteSquare").createAssetCopy("terrain"); texture = new DrawableTexture(terrainTexture , this); texture.size = size; texture.layer = 1f; this.size = size; textureLoaded = false; loadingTexture = false; }
private void CreateLand(LandsDbContext context, string address, int price, int area, bool electricity, bool water, bool sewage, string imageUrl) { Land land = new Land() { Address = address, Price = price, Area = area, Electricity = electricity, Water = water, Sewage = sewage, ImageUrl = imageUrl }; context.Lands.Add(land); context.SaveChanges(); }
virtual public Unit SummonUnit(GameObject _object, Land _Pos) { Unit monster; if (monster = Instantiate(_object).GetComponent <Unit>()) { Vector3 pos = Vector3.zero; Vector3 Scale = monster.transform.localScale; monster.transform.SetParent(_Pos.transform); monster.transform.localPosition = pos; monster.transform.localScale = Scale; monster.Faction = Faction; monster.playable = false; } return(null); }
public LandCard(Land land, string symbol) { this.land = land; if (symbol.Equals("Cavalry", StringComparison.OrdinalIgnoreCase)) { this.symbol = Symbol.Cavalry; } else if (symbol.Equals("Infantry", StringComparison.OrdinalIgnoreCase)) { this.symbol = Symbol.Infantry; } else { this.symbol = Symbol.Artillery; } }
public void TestRelatedObject() { pm.MakePersistent(l); pm.MakePersistent(f); l.AddFlughafen(f); pm.Save(); pm.MakeHollow(f); f.Kürzel = "XXX"; pm.Save(); // Bug would overwrite foreign key in database. Assert.AreEqual("XXX", f.Kürzel, "Kürzel should be changed"); ObjectId id = l.NDOObjectId; pm.UnloadCache(); l = (Land)pm.FindObject(id); Assert.AreEqual(1, l.Flughäfen.Count, "Number of children"); }
IEnumerator AttackAnim(Land _dest) { yield return(null); Vector3 startPos = transform.position; float timer = 0.0f; while (timer < 0.2f) { transform.position = Vector3.MoveTowards(transform.position, _dest.transform.position, Time.deltaTime * 3.0f); //transform.Translate(Vector3.up * Time.deltaTime * 3.0f); timer += Time.deltaTime; yield return(null); } transform.position = startPos; }
public LandCard(Land land, int symbol) { this.land = land; if (symbol == 0) { this.symbol = Symbol.Cavalry; } else if (symbol == 1) { this.symbol = Symbol.Infantry; } else { this.symbol = Symbol.Artillery; } }
public Land(Land otherLand) { xyCoo = otherLand.getXyCoo(); coordinate = otherLand.getCoordinates(); blockPref = otherLand.getPref(); ID = otherLand.getID(); bluePin = otherLand.GetBPin(); redPin = otherLand.GetRPin(); greenPin = otherLand.GetGPin(); yellowPin = otherLand.GetYPin(); CenterPin = otherLand.GetCenterPin(); name = otherLand.getName(); Debug.Log("New Created"); Debug.Log("ID" + ID); Debug.Log("coordinate" + coordinate); }
public void IsHouseBuildable_TrueWhenInMonopolyAndNoHouses() { Board board = new Board(); Land landTest1 = new Land("id1", "Rue de la paix", Color.Green, 300, new int[] { 50, 100, 140, 250, 300, 450 }, 200, board); board.Add(landTest1); Land landTest2 = new Land("id2", "2e Rue de la paix", Color.Green, 300, new int[] { 50, 100, 140, 250, 300, 450 }, 200, board); board.Add(landTest2); Player p0 = new Player(0, "p0", 500); landTest1.Owner = p0; landTest2.Owner = p0; Assert.IsTrue(landTest1.IsHouseBuildable() && landTest2.IsHouseBuildable()); }
public Mountain(int seed, Land world, float radius) : base(world) { this.seed = seed; assetTexture = AssetManager.getAssetTexture("whiteSquare").createAssetCopy("mountainTexture"); texture = new DrawableTexture(assetTexture, this); Random rdm = new Random(seed); texture.rotation = (float)rdm.NextDouble() * (float)Math.PI * 2f; this.radius = radius; //radius = MathHelper.Clamp(MathHelper.getNextNormalDistributedFloat(3f, 1f, rdm) * 50f, 30f, 500f); texture.size = new Vector2(radius*2f, radius*2f); texture.layer = 0.07f; textureLoaded = false; loadingTexture = false; }
public Tree(int seed, float radius, Land world) : base(world) { Random rdm = new Random(seed); drawTexture = new DrawableTexture(world.getTextureForTree(radius),this); //texture.filter = Color.ForestGreen; drawTexture.size = Vector2.One * radius*2f; drawTexture.layer = 0.05f; drawTexture.rotation = (float)rdm.NextDouble() * 2f * (float)Math.PI; this.radius = radius; oscilation += (float)rdm.NextDouble()*(float)Math.PI*2f; shadowTexture = new DrawableTexture(world.getTextureForTree(radius), this); shadowTexture.size = Vector2.One * radius * 2f * 1.1f; shadowTexture.layer = 0.1f; shadowTexture.rotation = drawTexture.rotation; shadowTexture.filter = Color.Lerp(Color.Transparent,Color.Black, 0.9f); physicalProperties = new LandPhysicalProperties(); physicalProperties.activelyColliding = false; physicalProperties.collisionType = LandCollisionTypes.Static; physicalProperties.radius = 2f; }
protected override IEnumerable<int> GetCoroutine(ActionArguments args, WarUnit doer, Point2 center, Action finished, Action doCoroutine) { // 行為のキャンセルの不許可 args.Model.CancelCommandStack.Clear(); // コストの消費 _cost.Expend(args.Situation, doer); // 攻撃アニメーションとその後の処理を予約する IEnumerable<Point2> areaPoints; var validPoints = _scope.GetValidAreaScope(args.Situation, doer, center, out areaPoints); _screenEffect.SetScreenEffect(args, doer, center, areaPoints, validPoints, doCoroutine); yield return 0; // エフェクト表示 // 対象内の壁を破壊 var map = args.Situation.Map; var enableDamageAnimation = false; foreach (var p in areaPoints) { var land = map[p]; if (land.Construct != null && land.Construct.Info.Name == "壁") { map[p] = new Land(land.Height, land.Landform, null); if (land.Unit != null && _attackType != AttackType.なし) { var taker = land.Unit; AdditionalEffect cond; var damage = BattleActionUtil.GetMagicDamage(doer, taker, _power, _attackType, out cond); BattleActionUtil.RunAttackRoutine(args, doer, taker, damage, cond, doCoroutine); enableDamageAnimation = true; } } } if (enableDamageAnimation) yield return 0; // ダメージ表示 finished(); }
protected override IEnumerable<int> GetCoroutine(ActionArguments args, WarUnit doer, Point2 center, Action finished, Action doCoroutine) { // 行為のキャンセルの不許可 args.Model.CancelCommandStack.Clear(); // コストの消費 _cost.Expend(args.Situation, doer); // 攻撃アニメーションとその後の処理を予約する IEnumerable<Point2> areaPoints; var validPoints = _scope.GetValidAreaScope(args.Situation, doer, center, out areaPoints); _screenEffect.SetScreenEffect(args, doer, center, areaPoints, validPoints, doCoroutine); yield return 0; // エフェクト表示 var lf = WarGlobal.Landforms; var landforms = new[,] { { lf[152], lf[143], lf[143], lf[143], lf[143], lf[153], null, null, null, null, null, }, { lf[159], lf[172], lf[163], lf[163], lf[163], lf[172], lf[158], null, null, null, null, }, { lf[159], lf[179], lf[172], lf[163], lf[163], lf[173], lf[178], lf[158], null, null, null, }, { lf[159], lf[179], lf[179], lf[172], lf[163], lf[173], lf[178], lf[178], lf[158], null, null, }, { lf[159], lf[179], lf[179], lf[179], lf[141], lf[141], lf[178], lf[178], lf[178], lf[158], null, }, { lf[144], lf[164], lf[164], lf[164], lf[141], lf[141], lf[141], lf[165], lf[165], lf[165], lf[145], }, { null, lf[156], lf[176], lf[176], lf[176], lf[141], lf[141], lf[177], lf[177], lf[177], lf[157], }, { null, null, lf[156], lf[176], lf[176], lf[174], lf[162], lf[175], lf[177], lf[177], lf[157], }, { null, null, null, lf[156], lf[176], lf[174], lf[162], lf[162], lf[175], lf[177], lf[157], }, { null, null, null, null, lf[156], lf[174], lf[162], lf[162], lf[162], lf[175], lf[157], }, { null, null, null, null, null, lf[154], lf[142], lf[142], lf[142], lf[142], lf[155], }, }; var heights = new[,] { { 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, }, { 4, 5, 5, 5, 5, 5, 4, 0, 0, 0, 0, }, { 4, 5, 6, 6, 6, 6, 5, 4, 0, 0, 0, }, { 4, 5, 6, 7, 7, 7, 6, 5, 4, 0, 0, }, { 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 0, }, { 4, 5, 6, 7, 8, 8, 8, 7, 6, 5, 4, }, { 0, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, }, { 0, 0, 4, 5, 6, 7, 7, 7, 6, 5, 4, }, { 0, 0, 0, 4, 5, 6, 6, 6, 6, 5, 4, }, { 0, 0, 0, 0, 4, 5, 5, 5, 5, 5, 4, }, { 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, }, }; // 地形書き換え処理 var map = args.Situation.Map; var sx = center.X - 5; var sy = center.Y - 5; foreach (var p in validPoints) { var taker = args.Situation.Map[p].Unit; AdditionalEffect cond; var damage = BattleActionUtil.GetMagicDamage(doer, taker, _power, _attackType, out cond); BattleActionUtil.RunAttackRoutine(args, doer, taker, damage, cond, doCoroutine); } foreach (var p in areaPoints) { // マップの更新 map[p] = new Land(heights[p.Y - sy, p.X - sx], landforms[p.Y - sy, p.X - sx], null); } yield return 0; // ダメージ表示 finished(); }
internal void UpdatePanel(Land land) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine(string.Format("you can upgrade your land: {0} price:{1}", land.name, land.tollBase)); messageText.text = stringBuilder.ToString(); }
/// <summary> /// Writes a Land data with specified index. /// </summary> /// <param name="index">Index between 0 and MaxIndex.</param> /// <param name="land">Data to write.</param> /// <exception cref="System.ObjectDisposedException">Object has been disposed.</exception> public void SetLand(int index, Land land) { lock (syncRoot) { if (Disposed) throw new ObjectDisposedException("TileData"); lands[index] = land; } }
public LandHuman(Land land, Creature human) : base(human, land) { }
//Constructors public Match(Karakter karakter, Tegenstander tegenstander, Land land) { Karakter = karakter; Tegenstander = tegenstander; Land = land; }
public Human(Land land) : base(land) { }
public override void PrepareForSave(LoanApplication loanApplication, PartyRole customerPartyRole, DateTime today) { //throw new NotImplementedException(); if (this.IsNew) { var asset = AddAsset(loanApplication, today); foreach (PropertyOwner owner in PropertyOwners) { owner.Add(asset, today); } Land land = new Land(); land.Asset = asset; land.UomId = this.LandUOM; land.LandTypeId = this.LandType; land.OctTctNumber = this.TCTNumber; land.LandArea = this.LandArea; //add property location var borrowerParty = Context.Parties.SingleOrDefault(entity => entity.Id == customerPartyRole.PartyId); var propertyLocation = PostalAddress.CreatePostalAddress(borrowerParty, PostalAddressType.PropertyLocationType, today); propertyLocation.StreetAddress = this.StreetAddress; propertyLocation.Barangay = this.Barangay; propertyLocation.Municipality = this.Municipality; propertyLocation.CountryId = this.CountryId; propertyLocation.City = this.City; propertyLocation.Province = this.Province; propertyLocation.PostalCode = this.PostalCode; propertyLocation.Address.Asset = asset; } else if (this.ToBeDeleted) { Asset asset = Context.Assets.SingleOrDefault(entity => entity.Id == this.AssetId); RemoveCurrentMortgagee(asset, today); foreach (PropertyOwner owner in PropertyOwners) { owner.Remove(today); } var borrowerParty = Context.Parties.SingleOrDefault(entity => entity.Id == customerPartyRole.PartyId); var propertyLocation = PostalAddress.GetCurrentPostalAddress(borrowerParty, PostalAddressType.PropertyLocationType, asset); if (asset.Land != null) { Address address = propertyLocation.Address; Context.Lands.DeleteObject(asset.Land); Context.PostalAddresses.DeleteObject(propertyLocation); Context.Addresses.DeleteObject(address); } Context.Assets.DeleteObject(asset); } else if (this.IsEdited) { Asset asset = Context.Assets.SingleOrDefault(entity => entity.Id == this.AssetId); UpdateAsset(asset, today); Land land = asset.Land; land.UomId = this.LandUOM; land.LandTypeId = this.LandType; land.OctTctNumber = this.TCTNumber; land.LandArea = this.LandArea; //add property location var borrowerParty = Context.Parties.SingleOrDefault(entity => entity.Id == customerPartyRole.PartyId); var currentPropertyLocation = PostalAddress.GetCurrentPostalAddress(borrowerParty, PostalAddressType.PropertyLocationType, asset); var propertyLocation = new PostalAddress(); propertyLocation.StreetAddress = this.StreetAddress; propertyLocation.Barangay = this.Barangay; propertyLocation.Municipality = this.Municipality; propertyLocation.CountryId = this.CountryId; propertyLocation.City = this.City; propertyLocation.Province = this.Province; propertyLocation.PostalCode = this.PostalCode; PostalAddress.CreateOrUpdatePostalAddress(currentPropertyLocation, propertyLocation, today); foreach (PropertyOwner owner in PropertyOwners) { owner.Save(asset, today); } }else if(this.IsNew == false && this.ToBeDeleted == false && this.IsEdited == false) { if (this.AssetId == 0) { var asset = AddAsset(loanApplication, today); foreach (PropertyOwner owner in PropertyOwners) { owner.Add(asset, today); } Land land = new Land(); land.Asset = asset; land.UomId = this.LandUOM; land.LandTypeId = this.LandType; land.OctTctNumber = this.TCTNumber; land.LandArea = this.LandArea; //add property location var borrowerParty = Context.Parties.SingleOrDefault(entity => entity.Id == customerPartyRole.PartyId); //var currentPropertyLocation = PostalAddress.GetCurrentPostalAddress(borrowerParty, PostalAddressType.PropertyLocationType, asset); var propertyLocation = PostalAddress.CreatePostalAddress(borrowerParty, PostalAddressType.PropertyLocationType, today); propertyLocation.StreetAddress = this.StreetAddress; propertyLocation.Barangay = this.Barangay; propertyLocation.Municipality = this.Municipality; propertyLocation.CountryId = this.CountryId; propertyLocation.City = this.City; propertyLocation.Province = this.Province; propertyLocation.PostalCode = this.PostalCode; propertyLocation.Address.Asset = asset; } } }
/// <summary> /// Static function that writes Land data to specified file at current location. /// </summary> /// <param name="writer">Stream to write to.</param> /// <param name="land">Object to write.</param> public static void WriteLand(BinaryWriter writer, Land land) { if (writer == null) throw new ArgumentNullException("writer"); writer.Write((uint)land.Flags); writer.Write(land.TextureID); writer.Write(land.NameBytes, 0, 20); }
public Rat(Land land) : base(land) { }
public Creature(Land land) { this.land = land; alive = true; }
public LandObject(Land land) : base(land) { }
/// <summary> /// Static function that reads Land data from specified file at current location. /// </summary> /// <param name="reader">Stream to read from.</param> /// <returns>Read data.</returns> public static Land ReadLand(BinaryReader reader) { if (reader == null) throw new ArgumentNullException("reader"); Land land = new Land(); land.Flags = (Flags)reader.ReadUInt32(); land.TextureID = reader.ReadUInt16(); land.NameBytes = reader.ReadBytes(20); return land; }