Example #1
0
    /* old get player inventory stuff
     * /// <summary>
     * /// Get the player's list of items
     * /// </summary>
     * /// <returns></returns>
     * public object GetPlayerItems() {
     * return playerItems;
     * }
     *
     * /// <summary>
     * /// Get the player's list of artifacts
     * /// </summary>
     * /// <returns></returns>
     * public object GetPlayerArtifacts() {
     * return playerArtifacts;
     * }
     *
     * /// <summary>
     * /// Get the player's list of effects
     * /// </summary>
     * /// <returns></returns>
     * public object GetPlayerEvents() {
     * return playerEvents;
     * }
     *
     * /// <summary>
     * /// Get the player's list of used items
     * /// </summary>
     * /// <returns></returns>
     * public object GetPlayerItemsUsed() {
     * return playerItemsUsed;
     * }
     *
     * /// <summary>
     * /// Get the player's list of used artifacts
     * /// </summary>
     * /// <returns></returns>
     * public object GetPlayerArtifactsUsed() {
     * return playerArtifactsUsed;
     * }
     *
     * /// <summary>
     * /// Get the player's list of used effects
     * /// </summary>
     * /// <returns></returns>
     * public object GetPlayerEventsUsed() {
     * return playerEventsUsed;
     * }
     */


    #region Inventory
    /// <summary>
    /// Get one of the parts of the players inventory
    /// Either used or unused, items, artifacts, events, or effects
    /// </summary>
    /// <param name="type">Which deck to get from: Item, Artifact, Event, or Effect, with "U_" at the begining for used</param>
    /// <param name="used">true if cards should be added to used part of inventory</param>
    /// <returns></returns>
    public CardDeck GetInventory(Card.ScriptType type, bool used)
    {
        if (!used)
        {
            switch (type)
            {
            case Card.ScriptType.Item: return(playerItems);

            case Card.ScriptType.Artifact: return(playerArtifacts);

            case Card.ScriptType.Event: return(playerEvents);

            case Card.ScriptType.Effect: return(playerEffects);

            default: return(null);
            }
        }
        else
        {
            switch (type)
            {
            case Card.ScriptType.Item: return(playerItemsUsed);

            case Card.ScriptType.Artifact: return(playerArtifactsUsed);

            case Card.ScriptType.Event: return(playerEventsUsed);

            case Card.ScriptType.Effect: return(playerEffectsUsed);

            default: return(null);
            }
        }
    }
Example #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="type"></param>
    /// <param name="used"></param>
    /// <param name="cards"></param>
    public void DiscardCard(Card.ScriptType type, bool used, /*Card*/ Card card)
    {
        // TODO: detect card type
        if (!used)
        {
            switch (type)
            {
            case Card.ScriptType.Item:
                playerItems.TakeCard(card);
                break;

            case Card.ScriptType.Artifact:
                playerArtifacts.TakeCard(card);
                break;

            case Card.ScriptType.Event:
                playerEvents.TakeCard(card);
                break;

            case Card.ScriptType.Effect:
                playerEffects.TakeCard(card);
                break;
            }
        }
        else
        {
            switch (type)
            {
            case Card.ScriptType.Item:
                playerItemsUsed.TakeCard(card);
                break;

            case Card.ScriptType.Artifact:
                playerArtifactsUsed.TakeCard(card);
                break;

            case Card.ScriptType.Event:
                playerEventsUsed.TakeCard(card);
                break;

            case Card.ScriptType.Effect:
                playerEffectsUsed.TakeCard(card);
                break;
            }
        }
    }
Example #3
0
    /// <summary>
    /// Adds a list of cards to a given part of the player's inventory
    /// </summary>
    /// <param name="type">Part of inventory to add cards to</param>
    /// <param name="used">true if cards should be added to used part of inventory</param>
    /// <param name="cards">Cards to add</param>
    public void AddCards(Card.ScriptType type, bool used, /*List<Card>*/ List <Card> cards)
    {
        //TODO: Automatically detect which part of inventory to put cards in
        if (!used)
        {
            switch (type)
            {
            case Card.ScriptType.Item:
                playerItems.AddCards(cards);
                break;

            case Card.ScriptType.Artifact:
                playerArtifacts.AddCards(cards);
                break;

            case Card.ScriptType.Event:
                playerEvents.AddCards(cards);
                break;

            case Card.ScriptType.Effect:
                playerEffects.AddCards(cards);
                break;
            }
        }
        else
        {
            switch (type)
            {
            case Card.ScriptType.Item:
                playerItemsUsed.AddCards(cards);
                break;

            case Card.ScriptType.Artifact:
                playerArtifactsUsed.AddCards(cards);
                break;

            case Card.ScriptType.Event:
                playerEventsUsed.AddCards(cards);
                break;

            case Card.ScriptType.Effect:
                playerEffectsUsed.AddCards(cards);
                break;
            }
        }
    }