void checkReleaseFromOwner(StatusLayer status)
 {
     if (status.Has(StatusEffect.STUNNED))
     {
         Controller = null;
     }
 }
Exemplo n.º 2
0
    public StatusLayer Copy()
    {
        StatusLayer layer = new StatusLayer();

        layer.statusList = new List <StatusEffect>(this.statusList);
        return(layer);
    }
 public void CheckStatusTimers(StatusLayer status)
 {
     //Add timers that are not already in the list
     foreach (StatusEffect effect in status.StatusEffects)
     {
         CheckStatusTimer(effect);
     }
 }
Exemplo n.º 4
0
    public StatusLayer stackAnd(StatusLayer status)
    {
        HashSet <StatusEffect> effects = new HashSet <StatusEffect>(this.statusList);

        effects.IntersectWith(status.statusList);
        StatusLayer layer = new StatusLayer(effects);

        return(layer);
    }
Exemplo n.º 5
0
    public StatusLayer stackOr(StatusLayer status)
    {
        HashSet <StatusEffect> effects = this.statusList.ToHashSet();

        effects.UnionWith(status.statusList);
        StatusLayer layer = new StatusLayer(effects);

        return(layer);
    }
Exemplo n.º 6
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    View view = inflater.Inflate(Resource.Layout.Prayer_Primary, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

                    ActivityIndicator            = (ProgressBar)view.FindViewById <ProgressBar>(Resource.Id.prayer_primary_activityIndicator);
                    ActivityIndicator.Visibility = ViewStates.Invisible;

                    // create the carousel
                    float prayerRegionHeight = GetPrayerRegionHeight( );

                    float cardWidth  = GetCardWidth( );
                    float cardHeight = GetCardHeight( );

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    float cardYOffset = (prayerRegionHeight - cardHeight) / 2;

                    PrayerCardSize = new RectangleF(0, 0, cardWidth, cardHeight);

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    Carousel = PlatformCardCarousel.Create(view, cardWidth, cardHeight, new RectangleF(0, cardYOffset, NavbarFragment.GetCurrentContainerDisplayWidth( ), prayerRegionHeight), PrivatePrayerConfig.Card_AnimationDuration);


                    // setup our error UI
                    StatusLayer = view.FindViewById <View>(Resource.Id.status_background);
                    ControlStyling.StyleBGLayer(StatusLayer);

                    StatusText = StatusLayer.FindViewById <TextView>(Resource.Id.text);
                    ControlStyling.StyleUILabel(StatusText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

                    ResultLayer = view.FindViewById <View>(Resource.Id.result_background);
                    ControlStyling.StyleBGLayer(ResultLayer);

                    ResultSymbol = ResultLayer.FindViewById <TextView>(Resource.Id.resultSymbol);
                    ResultSymbol.SetTypeface(FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary), TypefaceStyle.Normal);
                    ResultSymbol.SetTextSize(ComplexUnitType.Dip, PrivatePrayerConfig.PostPrayer_ResultSymbolSize_Droid);
                    ResultSymbol.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_ActiveTextColor));
                    ResultSymbol.Text = PrivateControlStylingConfig.Result_Symbol_Failed;

                    ResultText = ResultLayer.FindViewById <TextView>(Resource.Id.text);
                    ControlStyling.StyleUILabel(ResultText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Large_FontSize);

                    RetryButton = view.FindViewById <Button>(Resource.Id.retryButton);
                    ControlStyling.StyleButton(RetryButton, GeneralStrings.Retry, ControlStylingConfig.Font_Regular, ControlStylingConfig.Large_FontSize);

                    RetryButton.Click += (object sender, EventArgs e) =>
                    {
                        if (IsRequesting == false)
                        {
                            DownloadPrayers( );
                        }
                    };

                    return(view);
                }