Пример #1
0
 void HandleSpotClicked(object o, SpotEventArgs e)
 {
     if (!(ActivePlayer() is AI))
     {
         Preview((Spot)o);
     }
 }
Пример #2
0
 protected virtual void RaiseClicked(SpotEventArgs e)
 {
     if (Clicked != null)
     {
         Clicked(this, e);
     }
 }
Пример #3
0
 protected virtual void RaiseEnabledChanged(SpotEventArgs e)
 {
     if (EnabledChanged != null)
     {
         EnabledChanged(this, e);
     }
 }
Пример #4
0
 protected virtual void RaiseOwnerChanged(SpotEventArgs e)
 {
     if (OwnerChanged != null)  // if there are some listeners
     {
         OwnerChanged(this, e); // notify all listeners
     }
 }
Пример #5
0
    void HandleSpotEnabledChanged(object o, SpotEventArgs e)
    {
        Spot spot = (Spot)o;

        if (spot.Enabled)
        {
            availableSpots.Add(spot);
        }
        else
        {
            availableSpots.Remove(spot);
        }
    }
Пример #6
0
    /// <summary>
    /// Change image to reflect the new owner
    /// </summary>
    /// <param name="o"></param>
    /// <param name="e"></param>
    public virtual void HandleSpotOwnerChanged(object o, SpotEventArgs e)
    {
        Player owner = o == null ? null : ((Spot)o).Owner;
        Image  image = GetComponent <Image>();

        if (owner != null)
        {
            image.sprite = owner.Sprite;
            image.color  = owner.Color;
        }
        else // no owner, clear the spot
        {
            image.sprite = empty;
            // color irrelevant as empty sprite is transparent
        }
    }
Пример #7
0
 /// <summary>
 /// Update the button and its colors to reflect the enabled state of spot
 /// </summary>
 /// <param name="o"></param>
 /// <param name="e"></param>
 public virtual void HandleSpotEnabledChanged(object o, SpotEventArgs e)
 {
     button.interactable = o == null ? false : ((Spot)o).Enabled;
 }
Пример #8
0
    void HandleSpotOwnerChanged(object o, SpotEventArgs e)
    {
        Spot spot = (Spot)o;

        UpdateOwnerArray(spot.Loc, spot.Owner);
    }