Ejemplo n.º 1
0
 // -------------------------------------------------------------------------------
 // getCurrencyAmount
 // -------------------------------------------------------------------------------
 public long getCurrencyAmount(_CurrencyTemplate _template)
 {
     return(currencies.FirstOrDefault(x => x.template == _template).amount);
 }
Ejemplo n.º 2
0
 // -------------------------------------------------------------------------------
 // getCurrencyIndex
 // -------------------------------------------------------------------------------
 public int getCurrencyIndex(_CurrencyTemplate _template)
 {
     return(currencies.FindIndex(x => x.template == _template));
 }
Ejemplo n.º 3
0
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // PUBLIC FUNCTIONS
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        // -------------------------------------------------------------------------------
        // addCurrency
        // -------------------------------------------------------------------------------
        public void addCurrency(_CurrencyTemplate _template, long _amount)
        {
            CurrencyInstance instance = new CurrencyInstance(game, _template, _amount);

            currencies.Add(instance);
        }
Ejemplo n.º 4
0
 // -------------------------------------------------------------------------------
 // hasCurrency
 // -------------------------------------------------------------------------------
 public bool hasCurrency(_CurrencyTemplate _template)
 {
     return(currencies.Exists(x => x.template == _template));
 }
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // PUBLIC FUNCTIONS
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        // -------------------------------------------------------------------------------
        // Constructor
        // -------------------------------------------------------------------------------
        public CurrencyInstance(GameManager _game, _CurrencyTemplate template, long _amount) : base(_game)
        {
            hash   = template.name.GetDeterministicHashCode();
            amount = _amount;
        }