コード例 #1
0
    // used by net interface for syncing
    public void RecieveCountersPlaced(CounterType counterType, int newCounters)
    {
        int currentCounters = Counters.AmountOf(counterType);

        if (currentCounters > newCounters)
        {
            Counters.Remove(counterType, currentCounters - newCounters);
        }
        else if (currentCounters < newCounters)
        {
            Counters.Add(counterType, newCounters - currentCounters);
        }
        else
        {
            Debug.Log("Trying to set counters to a value it's already set to. This shouldn't happen under normal circumstances");
        }
    }
コード例 #2
0
 public void SyncCounters(CounterType counterType)
 {
     NetInterface.Get().SyncCounterPlaced(SourceCard, counterType, Counters.AmountOf(counterType));
 }