Пример #1
0
 public void Teardown()
 {
     cardUnit     = null;
     cardBuilding = null;
     cardResource = null;
     C.Destroy(player.gameObject);
 }
 public void Teardown()
 {
     Object.DestroyImmediate(buildingWithoutCard.gameObject);
     Object.DestroyImmediate(building1.gameObject);
     Object.DestroyImmediate(building2.gameObject);
     cardBuilding = null;
 }
Пример #3
0
 public void Setup()
 {
     player       = PlayerUTests.CreateTestPlayer();
     cardUnit     = CardUnitUTests.CreateTestCardUnit();
     cardBuilding = CardBuildingUTests.CreateTestCardBuilding();
     cardResource = CardResourceUTests.CreateTestFoodCardResource();
 }
Пример #4
0
    // Create starting castle
    public static GamePiece CreateCastle(Player player)
    {
        CardBuilding castle      = Resources.Load <CardBuilding>(ENV.CASTLE_CARD_RESOURCE_PATH);
        GamePiece    castlePiece = CreatePiece <Building>(castle, player);

        return(castlePiece);
    }
 public void Setup()
 {
     buildingWithoutCard = BuildingUTests.CreateTestBuilding();
     building1           = CreateTestBuildingWithCard();
     building2           = CreateTestBuildingWithCard();
     cardBuilding        = CardBuildingUTests.CreateTestCardBuilding();
 }
        // Create test card building display
        public static CardBuildingDisplay CreateTestCardBuildingDisplay()
        {
            CardBuilding        cardBuilding        = CardBuildingUTests.CreateTestCardBuilding();
            CardBuildingDisplay cardBuildingDisplay = CardBuildingDisplayUTests.CreateTestCardBuildingDisplay();

            cardBuildingDisplay.SetCard(cardBuilding);
            return(cardBuildingDisplay);
        }
        // Create test unit with card
        public static Building CreateTestBuildingWithCard()
        {
            CardBuilding cardBuilding = CardBuildingUTests.CreateTestCardBuilding();
            Building     building     = BuildingUTests.CreateTestBuilding();

            building.SetCard(cardBuilding);
            return(building);
        }
Пример #8
0
        public static Card.ICard AllSpellDecision()
        {
            IOrderedEnumerable <Spell> troopCycleSpells = CardClassifying.TroopCycleCards;
            IOrderedEnumerable <Spell> damagingSpells   = CardClassifying.Damaging;

            if (DamagingSpellDecision())
            {
                var damagingSpell = damagingSpells.FirstOrDefault();

                if (damagingSpell != null)
                {
                    return(new CardSpell(damagingSpell.Name.Value, SpellType.SpellDamaging));
                }
            }

            if (IsAOEAttackNeeded())
            {
                var spell = CardClassifying.TroopAOEAttack.FirstOrDefault();
                if (spell == null)
                {
                    spell = CardClassifying.TroopGroundAttack.FirstOrDefault();
                }

                if (spell != null)
                {
                    return(new CardCharacter(spell.Name.Value, TroopType.AOEAttackGround));
                }
            }

            if (IsFlyingAttackNeeded())
            {
                var spell = CardClassifying.TroopAirAttack.FirstOrDefault();
                if (spell != null)
                {
                    return(new CardCharacter(spell.Name.Value, TroopType.AOEAttackFlying));
                }
            }

            if (DeployBuildingDecision())
            {
                // ToDo: Take right building and set right Building-Type
                CardBuilding spell = BuildingsSpellDecision();
                if (spell != null)
                {
                    return(new CardBuilding(spell.Name, spell.Type));
                }
            }

            // ToDo: Ranger, Flying usw.
            if (troopCycleSpells.Count() > 1)
            {
                var spell = troopCycleSpells.FirstOrDefault();
                return(new CardCharacter(spell.Name.Value, TroopType.Ranger));
            }

            return(TroopPowerSpells());
        }
Пример #9
0
 // Set card
 public override void SetCard(Card card)
 {
     if (card is CardBuilding)
     {
         CardBuilding cardBuilding = (CardBuilding)card;
         this.cardBuilding = cardBuilding;
         Initialize();
     }
 }
Пример #10
0
 // Set card
 public override void SetCard(CardPiece cardPiece)
 {
     if (cardPiece is CardBuilding)
     {
         CardBuilding cardBuilding = (CardBuilding)cardPiece;
         this.cardBuilding = cardBuilding;
         pieceType         = PieceType.Building;
         SetCardStats(cardBuilding);
     }
 }
Пример #11
0
    public void PlayBuilding(Vector3 tileCoords)
    {
        Tile         tile     = map.GetTileFromCoords(tileCoords);
        CardBuilding card     = (CardBuilding)Card.CreateCard(CardType.Building, deck.allCards[0]);
        Building     building = (Building)GamePiece.CreatePiece(this, card, tile);

        map.AddBuilding(building);
        //hand.PlayCard(card);
        if (!deck.DrawButtonEnabled())
        {
            deck.EnableDrawButton();
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        // Create unit
        unitPrefab = Instantiate(unitPrefab);
        unit       = unitPrefab.GetComponent <Unit>();
        cardUnit   = CardUnit.LoadTestCardUnit();
        unit.SetCard(cardUnit);

        // Create building
        buildingPrefab = Instantiate(buildingPrefab);
        building       = buildingPrefab.GetComponent <Building>();
        cardBuilding   = CardBuilding.LoadTestCardBuilding();
        building.SetCard(cardBuilding);
    }
Пример #13
0
    // Use this for initialization
    void Start()
    {
        players = new Player[GameSetupData.numPlayers];

        cityPath = "Assets/Cards/Building Cards/City.asset";
        CardBuilding city = (CardBuilding)Card.CreateCard(CardType.Building, cityPath);

        for (int i = 0; i < players.Length; i++)
        {
            players[i]             = Instantiate(playerObject);
            players[i].playerIndex = i;
            players[i].transform.SetParent(this.transform);
            Building building = (Building)GamePiece.CreatePiece(players[i], city, map.GetTileFromCoords(startLocations[i]));
            map.AddBuilding(building);
        }
    }
    // Load a test card building
    public static CardBuilding LoadTestCardBuilding()
    {
        CardBuilding newCard = Resources.Load <CardBuilding>(ENV.CARD_BUILDING_TEST_RESOURCE_PATH);

        return(newCard);
    }
Пример #15
0
 public void Teardown()
 {
     cardBuilding = null;
 }
Пример #16
0
 public void Setup()
 {
     cardBuilding = CreateTestCardBuilding();
 }