Ejemplo n.º 1
0
 public LandCreature(Creature creature, Land land)
     : base(land)
 {
     this.creature = creature;
     creature.landCreature = this;
     encounterTrigger = new Encounter(this, land);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public Faction(Land land)
 {
     this.land = land;
     allies = new List<Faction>();
     enemys = new List<Faction>();
     agressiveTowardsNeutrals = false;
     allyTowardsNeutrals = false;
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
        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;
        }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        public WaterTile(Vector2 position, Vector2 size, Land land, int seed)
            : base(land)
        {
            this.position = position;
            this.seed = seed;

            this.size = size;

            textureLoaded = false;
        }
Ejemplo n.º 11
0
        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;
    }
Ejemplo n.º 13
0
        // 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));
        }
Ejemplo n.º 14
0
        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;
        }
Ejemplo n.º 15
0
    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);
    }
Ejemplo n.º 16
0
    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);
        };
    }
Ejemplo n.º 17
0
        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;
        }
Ejemplo n.º 18
0
        /// <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);
        }
Ejemplo n.º 19
0
 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;
     }
 }
Ejemplo n.º 20
0
 /// <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);
     }
 }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
        // 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));
        }
Ejemplo n.º 24
0
        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;
        }
Ejemplo n.º 25
0
 /* 场记接口方法的实现,主要完成场景载入 */
 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);
     }
 }
Ejemplo n.º 26
0
        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");
        }
Ejemplo n.º 27
0
        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());
        }
Ejemplo n.º 28
0
        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));
        }
Ejemplo n.º 29
0
 /// <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();
     }
 }
Ejemplo n.º 30
0
        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();
        }
Ejemplo n.º 31
0
    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);
    }
Ejemplo n.º 32
0
        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");
            }
        }
Ejemplo n.º 34
0
        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);
                }
            }
        }
Ejemplo n.º 35
0
        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);
        }
Ejemplo n.º 36
0
        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();
        }
Ejemplo n.º 37
0
        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();
        }
Ejemplo n.º 39
0
    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;
     }
 }
Ejemplo n.º 41
0
        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");
        }
Ejemplo n.º 42
0
    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;
     }
 }
Ejemplo n.º 44
0
 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);
 }
Ejemplo n.º 45
0
        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());
        }
Ejemplo n.º 46
0
        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;
        }
Ejemplo n.º 47
0
        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;
        }
Ejemplo n.º 48
0
        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();
        }
Ejemplo n.º 49
0
        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();
 }
Ejemplo n.º 51
0
        /// <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;
            }
        }
Ejemplo n.º 52
0
 public LandHuman(Land land, Creature human)
     : base(human, land)
 {
 }
Ejemplo n.º 53
0
 //Constructors
 public Match(Karakter karakter, Tegenstander tegenstander, Land land)
 {
     Karakter = karakter;
     Tegenstander = tegenstander;
     Land = land;
 }
Ejemplo n.º 54
0
 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;
                }
            }
        }
Ejemplo n.º 56
0
        /// <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);
        }
Ejemplo n.º 57
0
 public Rat(Land land)
     : base(land)
 {
 }
Ejemplo n.º 58
0
 public Creature(Land land)
 {
     this.land = land;
     alive = true;
 }
Ejemplo n.º 59
0
 public LandObject(Land land)
     : base(land)
 {
 }
Ejemplo n.º 60
0
        /// <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;
        }