예제 #1
0
    // for debug;

    /*public void RenderPartialMapForTest() {
     *  GameObject chunk = Instantiate((GameObject)Resources.Load("Prefabs/Chunk"), new Vector3(0, 0, 0), transform.rotation);
     *  chunk.transform.parent = worldMapTransform;
     *  Chunk ck = chunk.GetComponent<Chunk>();
     *  ck.tilesLightMap = tilesLightMap;
     *  ck.wallTilesMap = wallTilesMap;
     *  ck.lightService = lightService;
     *  ck.tilesShadowMap = tilesShadowMap;
     *  ck.chunkSize = chunkSize;
     *  ck.tilebaseDictionary = tilebaseDictionary;
     *  ck.indexX = 0;
     *  ck.indexY = 0;
     * }*/
    public void InitialiseChunkPooling()
    {
        for (var i = 0; i < numberOfPool; i++)
        {
            GameObject chunk = Instantiate((GameObject)Resources.Load("Prefabs/Chunk"), new Vector3(0, 0, 0), transform.rotation);
            chunk.transform.parent = worldMapTransform;
            Chunk     ck = chunk.GetComponent <Chunk>();
            IsVisible isVisibleScript = ck.tilemapTile.GetComponent <IsVisible>();
            isVisibleScript.cam     = playerCam;
            isVisibleScript.chunk   = ck;
            ck.tileMapTileMapScript = ck.tilemapTile.GetComponent <TileMapScript>();
            ck.wallTileMapScript    = ck.tilemapWall.GetComponent <TileMapScript>();
            ck.shadowTileMapScript  = ck.tilemapShadow.GetComponent <TileMapScript>();
            chunk.gameObject.SetActive(false);
            ck.tilesLightMap      = tilesLightMap;
            ck.wallTilesMap       = wallTilesMap;
            ck.chunkSize          = chunkSize;
            ck.lightService       = lightService;
            ck.tilebaseDictionary = tilebaseDictionary;
            ck.tilesMap           = null;
            ck.tilesShadowMap     = tilesShadowMap;
            ck.indexX             = -1;
            ck.indexY             = -1;
            unUsedChunk.Add(ck);
        }
    }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="writer"></param>
        /// <returns></returns>
        public override bool Save(XmlWriter writer)
        {
            if (writer == null)
            {
                return(false);
            }


            writer.WriteStartElement(Tag);
            writer.WriteAttributeString("team", TeleportTeam.ToString());
            writer.WriteAttributeString("monsters", TeleportMonsters.ToString());
            writer.WriteAttributeString("items", TeleportItems.ToString());
            writer.WriteAttributeString("visible", IsVisible.ToString());
            writer.WriteAttributeString("reusable", Reusable.ToString());

            if (Target != null)
            {
                Target.Save("target", writer);
            }

            base.Save(writer);

            writer.WriteEndElement();

            return(true);
        }
예제 #3
0
        public bool Equals(DestinyItemSocketState input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     PlugHash == input.PlugHash ||
                     (PlugHash.Equals(input.PlugHash))
                     ) &&
                 (
                     IsEnabled == input.IsEnabled ||
                     (IsEnabled != null && IsEnabled.Equals(input.IsEnabled))
                 ) &&
                 (
                     IsVisible == input.IsVisible ||
                     (IsVisible != null && IsVisible.Equals(input.IsVisible))
                 ) &&
                 (
                     EnableFailIndexes == input.EnableFailIndexes ||
                     (EnableFailIndexes != null && EnableFailIndexes.SequenceEqual(input.EnableFailIndexes))
                 ));
        }
예제 #4
0
        public override int GetHashCode()
        {
            var hashCode = -1294847358;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <Account> .Default.GetHashCode(Account);

            hashCode = hashCode * -1521134295 + CreateDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <DateTime?> .Default.GetHashCode(LastModification);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Title);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Description);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Content);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Paragraph> > .Default.GetHashCode(Paragraphs);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ImageUrl);

            hashCode = hashCode * -1521134295 + IsVisible.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <ContentCategory> .Default.GetHashCode(ContentCategory);

            hashCode = hashCode * -1521134295 + EqualityComparer <Account> .Default.GetHashCode(LastModifiedBy);

            return(hashCode);
        }
예제 #5
0
        public override void WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteAttributeString("IsVisible", IsVisible.ToString());
            if (!CanHide)
            {
                writer.WriteAttributeString("CanHide", CanHide.ToString());
            }
            if (!CanAutoHide)
            {
                writer.WriteAttributeString("CanAutoHide", CanAutoHide.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideWidth > 0)
            {
                writer.WriteAttributeString("AutoHideWidth", AutoHideWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideHeight > 0)
            {
                writer.WriteAttributeString("AutoHideHeight", AutoHideHeight.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideMinWidth != 25.0)
            {
                writer.WriteAttributeString("AutoHideMinWidth", AutoHideMinWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (AutoHideMinHeight != 25.0)
            {
                writer.WriteAttributeString("AutoHideMinHeight", AutoHideMinHeight.ToString(CultureInfo.InvariantCulture));
            }


            base.WriteXml(writer);
        }
예제 #6
0
 public Statement(string id, Conversation conversation, string text, OnReply onReply, IsVisible isVisible)
 {
     this.id = id;
     this.conversation = conversation;
     this.text = text;
     this.onReplyCallBack = onReply;
     this.isVisible = isVisible;
 }
예제 #7
0
        public override int GetHashCode()
        {
            int hashResult = Name == null ? 0 : Name.GetHashCode();

            hashResult ^= IsVisible.GetHashCode();
            hashResult ^= IsSystem.GetHashCode();
            hashResult ^= IsDeleted.GetHashCode();
            return(hashResult);
        }
예제 #8
0
 /// <summary>
 /// Converts this OverlayWindow structure to a human-readable string.
 /// </summary>
 /// <returns>A string representation of this OverlayWindow.</returns>
 public override string ToString()
 {
     return(OverrideHelper.ToString(
                "Handle", Handle.ToString("X"),
                "IsInitialized", IsInitialized.ToString(),
                "IsVisible", IsVisible.ToString(),
                "IsTopmost", IsTopmost.ToString(),
                "X", X.ToString(),
                "Y", Y.ToString(),
                "Width", Width.ToString(),
                "Height", Height.ToString()));
 }
예제 #9
0
        public override int GetHashCode()
        {
            int hashCode = 312150486;

            hashCode = hashCode * -1521134295 + ID.GetHashCode();
            hashCode = hashCode * -1521134295 + IsVisible.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CustomName);

            hashCode = hashCode * -1521134295 + EqualityComparer <Type> .Default.GetHashCode(Type);

            return(hashCode);
        }
예제 #10
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = m_Name != null?m_Name.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (m_FinalName != null ? m_FinalName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (TypeDefinition != null ? TypeDefinition.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ IsVisible.GetHashCode();
                hashCode = (hashCode * 397) ^ ( int )Size;
                hashCode = (hashCode * 397) ^ (InitContent != null ? InitContent.GetHashCode() : 0);

                return(hashCode);
            }
        }
예제 #11
0
        public List <KeyValuePair <string, object> > Serialize()
        {
            var list = new List <KeyValuePair <string, object> > ();

            list.Add(new KeyValuePair <string, object>("id", String.Format("\"{0}\"", Id.Trim())));
            foreach (var cell in Cells)
            {
                list.Add(new KeyValuePair <string, object> ("cell", cell.Serialize()));
            }

            list.Add(new KeyValuePair <string, object>("z", Z.ToString()));
            list.Add(new KeyValuePair <string, object>("is_visible", IsVisible.ToString()));

            return(list);
        }
        protected sealed override async UniTask OnInitialize(TWindowModel model)
        {
            await base.OnInitialize(model);

            IsVisible.
            Where(x => x).
            Subscribe(x => canvasGroup.SetState(visibleState)).
            AddTo(LifeTime);

            IsVisible.
            Where(x => !x).
            Subscribe(x => canvasGroup.SetState(hiddenState)).
            AddTo(LifeTime);

            await OnViewInitialize(model);
        }
예제 #13
0
 public static void UpdateVisibilityBoard()
 {
     for (int i = 0; i < IsVisible.GetLength(0); i++)
     {
         for (int j = 0; j < IsVisible.GetLength(1); j++)
         {
             if (i == 0 || j == 0 || i == IsVisible.GetLength(0) - 1 || j == IsVisible.GetLength(1) - 1)
             {
                 IsVisible[i, j] = true;
             }
             else
             {
                 IsVisible[i, j] = false;
             }
         }
     }
 }
예제 #14
0
 public void PlayerUpdateVisibility()
 {
     for (int i = 0; i < 16; i++)
     {
         for (int j = 0; j < 40; j++)
         {
             if (Y - 8 + i > 0 && X - 20 + j > 0 && Y - 8 + i < IsVisible.GetLength(0) &&
                 X - 20 + j < IsVisible.GetLength(1))
             {
                 if (IsVisible[Y - 8 + i, X - 20 + j] == false)
                 {
                     IsVisible[Y - 8 + i, X - 20 + j] = true;
                 }
             }
         }
     }
 }
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)UnitType;
         hashCode = (hashCode * 397) ^ (int)ParameterGroup;
         hashCode = (hashCode * 397) ^ (int)ParameterType;
         hashCode = (hashCode * 397) ^ (int)DisplayUnitType;
         hashCode = (hashCode * 397) ^ (Group != null ? Group.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DataCategory != null ? DataCategory.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsVisible.GetHashCode();
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ UserModifiable.GetHashCode();
         return(hashCode);
     }
 }
예제 #16
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ HasError.GetHashCode();
         hashCode = (hashCode * 397) ^ (ErrorMessage != null ? ErrorMessage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsEditable.GetHashCode();
         hashCode = (hashCode * 397) ^ IsVisible.GetHashCode();
         hashCode = (hashCode * 397) ^ IsSelected.GetHashCode();
         hashCode = (hashCode * 397) ^ IsUsed.GetHashCode();
         hashCode = (hashCode * 397) ^ AllowNotes.GetHashCode();
         hashCode = (hashCode * 397) ^ IsComplexObject.GetHashCode();
         hashCode = (hashCode * 397) ^ (DisplayName != null ? DisplayName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)ColumnIODirection;
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #17
0
        public XmlElement GenerateXmlElement(XmlDocument doc)
        {
            var node = doc.CreateElement("Viewport");

            node.SetAttribute("Index", ScreenIndex.ToString());
            node.SetAttribute("Name", Name);
            if (!IsVisible)
            {
                node.SetAttribute("IsVisible", IsVisible.ToString());
            }
            node.SetAttribute("TimeLength", TimeLength.ToString());
            node.SetAttribute("SwitchMode", SwitchMode.ToString());
            node.SetAttribute("SwitchHotKey", SwitchHotKey.ToString());
            if (ElementsCaptionColor != System.Drawing.Color.White)
            {
                node.SetAttribute("ElementsCaptionColor", ElementsCaptionColor.ToArgb().ToString());
            }
            if (ElementsCaptionScale != 1)
            {
                node.SetAttribute("ElementsCaptionScale", ElementsCaptionScale.ToString());
            }
            foreach (var elm in Elements)
            {
                if (elm == null)
                {
                    continue;
                }
                if (elm.Resource != null && elm.Resource.FullFilePath == ResourceInfo_BackgroundImage.DefaultBackgroundImageFile)
                {
                    continue;
                }
                var enode = elm.GenerateXmlElement(doc);
                node.AppendChild(enode);
            }
            var gnode = ElemGroupCollector.GenerateXmlElement(doc);

            if (gnode != null)
            {
                node.AppendChild(gnode);
            }
            return(node);
        }
        public override int GetHashCode()
        {
            var result = 37;

            unchecked
            {
                result = result * 17 + base.GetHashCode();
                result = result * 17 + SeqNumber;
                result = result * 17 + (ColumnFields?.Select(f => f.GetHashCode()).UncheckedSum() ?? 0);
                result = result * 17 + (int)FieldType;
                result = result * 17 + FormatTypeId;
                result = result * 17 + (CurrencyCode?.GetHashCode() ?? 0);
                result = result * 17 + HasSubtotals.GetHashCode();
                result = result * 17 + HasTotals.GetHashCode();
                result = result * 17 + (int)TotalsAggregation;
                result = result * 17 + IsVisible.GetHashCode();
                if (ColumnGroupId != null)
                {
                    result = result * 17 + ColumnGroupId.Value;
                }
            }

            return(result);
        }
예제 #19
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //STEPPER
            case nameof(Maximum):
                return(Maximum.ToString());

            case nameof(Minimum):
                return(Minimum.ToString());

            case nameof(Value):
                return(Value.ToString());

            case nameof(Increment):
                return(Increment.ToString());

            default:
                return(string.Empty);
            }
        }
예제 #20
0
파일: Picker.cs 프로젝트: pranart/FormsTest
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //PICKER
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SelectedIndex):
                return(SelectedIndex.ToString());

            case nameof(Items):
                return(Items.Aggregate((x, y) => x + "," + y));

            case nameof(Title):
                return(Title);

            default:
                return(string.Empty);
            }
        }
예제 #21
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //ITEMSVIEW
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            //LISTVIEW
            case nameof(HasUnevenRows):
                return(HasUnevenRows.ToString());

            case nameof(IsGroupingEnabled):
                return(IsGroupingEnabled.ToString());

            case nameof(RowHeight):
                return(RowHeight.ToString());

            case nameof(Footer):
                return(Footer.ToString());

            case nameof(Header):
                return(Header.ToString());

            case nameof(IsPullToRefreshEnabled):
                return(IsPullToRefreshEnabled.ToString());

            case nameof(IsRefreshing):
                return(IsRefreshing.ToString());

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SeparatorColor):
                return(SeparatorColor.ToHex());

            case nameof(this.SeparatorVisibility):
                return(SeparatorVisibility.ToString());

            default:
                return(string.Empty);
            }
        }
예제 #22
0
        // update
        // - check for mouse hovering and click (select)
        public void Update(GameTime gameTime, KeyboardState keyboardState, Camera camera, GameState state)
        {
            // update tile?
            IsGlowing        = false;
            IsPreviewingRoad = false;

            #region MOUSE INTERACTION LOGIC
            var currentMouse = Mouse.GetState();

            // convert mouse screen position to world position
            var m_screenPosition = new Vector2(currentMouse.X, currentMouse.Y);
            var m_worldPosition  = Vector2.Zero;
            camera.ToWorld(ref m_screenPosition, out m_worldPosition);

            // apply offset (why the f**k this is needed I absolutely do not know but I randomly f*****g figured out this formula and somehow it works so for the love of f**k - do not change this until a superior solution is TESTED and delivered
            m_worldPosition.X -= camera.Width / 2f;
            m_worldPosition.Y -= camera.Height / 2f;

            //m_worldPosition.X += (GraphicsDevice_.Viewport.Width * 0.25f);
            //m_worldPosition.Y += (GraphicsDevice_.Viewport.Height * 0.25f);

            // get bounds for mouse world position
            var mouseRectangle = new Rectangle((int)m_worldPosition.X, (int)m_worldPosition.Y, 1, 1);

            // check if mouse bounds intersects with tile touchbox bounds
            if (mouseRectangle.Intersects(TouchHitbox) && IsVisible.Equals(true))
            {
                state.CurrentlyHoveredTile = this;
                //Console.WriteLine($"Hover:: Mp=>{currentMouse.Position.ToString()} :: Mwp=>{m_worldPosition.ToString()} :: Tp=>{Position.ToString()}");
                //Console.WriteLine($"Hovering Over Tile: {TileIndex.ToString()}");

                switch (currentMouse.LeftButton)
                {
                case ButtonState.Pressed when _previousMouseState.LeftButton == ButtonState.Pressed:
                    if (!(state.CurrentlyPressedTile.TileIndex.Equals(TileIndex)))
                    {
                        Pressing?.Invoke(this, new EventArgs());
                    }
                    break;

                case ButtonState.Pressed when _previousMouseState.LeftButton == ButtonState.Released:
                    Pressed?.Invoke(this, new EventArgs());
                    break;

                case ButtonState.Released when _previousMouseState.LeftButton == ButtonState.Pressed:
                    Click?.Invoke(this, new EventArgs());
                    break;
                }

                if (currentMouse.RightButton == ButtonState.Released && _previousMouseState.RightButton == ButtonState.Pressed)
                {
                    //camera.Position = Position + new Vector2(0, 150);
                    RightClick?.Invoke(this, new EventArgs());
                }
            }

            #endregion


            if (Object is Residence r)
            {
                //Console.Out.WriteLine("Listing residents for tile: {0}", TileIndex.ToString());
                foreach (var res in r.Residents)
                {
                    //Console.Out.WriteLine("res.Name = {0}", res.Name);
                }
            }

            if (HasAnimatedTexture == false)
            {
                CheckForAnimatedTexture();
            }

            // save mouse state as previous mousestate for next update call
            _previousMouseState = currentMouse;

            _gameState = state;
        }
예제 #23
0
파일: Button.cs 프로젝트: pranart/FormTest
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //BUTTON
            case nameof(BorderColor):
                return(BorderColor.ToHex());

    #pragma warning disable CS0618 // Type or member is obsolete
            case nameof(BorderRadius):
                return(BorderRadius.ToString());

    #pragma warning restore CS0618 // Type or member is obsolete
            case nameof(BorderWidth):
                return(BorderWidth.ToString());

            case nameof(CornerRadius):
                return(CornerRadius.ToString());

            case nameof(CommandParameter):
                return(CommandParameter.ToString());

            case nameof(FontAttributes):
                return(FontAttributes.ToString());

            case nameof(FontFamily):
                return(FontFamily);

            case nameof(FontSize):
                return(FontSize.ToString());

            case nameof(TextColor):
                return(TextColor.ToHex());

            case nameof(Text):
                return(Text);

            default:
                return(string.Empty);
            }
        }
예제 #24
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
                //ELEMENT
                case nameof(ClassId):
                    return ClassId.ToString();
                case nameof(AutomationId):
                    return AutomationId.ToString();
                case nameof(Id):
                    return Id.ToString();
                case nameof(StyleId):
                    return StyleId.ToString();
                //VISUAL ELEMENT
                case nameof(AnchorX):
                    return AnchorX.ToString();
                case nameof(AnchorY):
                    return AnchorY.ToString();
                case nameof(BackgroundColor):
                    return BackgroundColor.ToHex();
                case nameof(Width):
                    return this.Width.ToString();
                case nameof(Height):
                    return this.Height.ToString();
                case nameof(IsEnabled):
                    return IsEnabled.ToString();
                case nameof(WidthRequest):
                    return this.WidthRequest.ToString();
                case nameof(HeightRequest):
                    return this.HeightRequest.ToString();
                case nameof(IsFocused):
                    return IsFocused.ToString();
                case nameof(IsVisible):
                    return IsVisible.ToString();
                case nameof(InputTransparent):
                    return InputTransparent.ToString();
                case nameof(X):
                    return this.X.ToString();
                case nameof(Y):
                    return this.Y.ToString();
                case nameof(Opacity):
                    return this.Opacity.ToString();
                case nameof(TranslationX):
                    return this.TranslationX.ToString();
                case nameof(TranslationY):
                    return this.TranslationY.ToString();
                case nameof(Rotation):
                    return this.Rotation.ToString();
                case nameof(RotationX):
                    return this.RotationX.ToString();
                case nameof(RotationY):
                    return this.RotationY.ToString();
                case nameof(Scale):
                    return this.Scale.ToString();
                //VIEW
                case nameof(Margin):
                    return this.Margin.ToString();
                case nameof(VerticalOptions):
                    return this.VerticalOptions.ToString();
                case nameof(HorizontalOptions):
                    return this.HorizontalOptions.ToString();

                //PROGRESSBAR
                case nameof(Progress):
                    return this.Progress.ToString();

                default:
                    return string.Empty;

            }
        }
예제 #25
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //SEARCHBAR
            case nameof(CancelButtonColor):
                return(this.CancelButtonColor.ToHex());

            case nameof(Placeholder):
                return(this.Placeholder);

            case nameof(SearchCommandParameter):
                return(SearchCommandParameter.ToString());

            case nameof(Text):
                return(Text);

            default:
                return(string.Empty);
            }
        }
예제 #26
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //IMAGE
            case nameof(Source):
                switch (Source)
                {
                case FileImageSource file:
                    return(file.File);

                case UriImageSource uri:
                    return(uri.Uri.ToString());

                default:
                    return(string.Empty);
                }

            case nameof(Aspect):
                return(this.Aspect.ToString());

            case nameof(IsOpaque):
                return(this.IsOpaque.ToString());

            default:
                return(string.Empty);
            }
        }
예제 #27
0
        public bool Equals(DestinyActivity input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     ActivityHash == input.ActivityHash ||
                     (ActivityHash.Equals(input.ActivityHash))
                     ) &&
                 (
                     IsNew == input.IsNew ||
                     (IsNew != null && IsNew.Equals(input.IsNew))
                 ) &&
                 (
                     CanLead == input.CanLead ||
                     (CanLead != null && CanLead.Equals(input.CanLead))
                 ) &&
                 (
                     CanJoin == input.CanJoin ||
                     (CanJoin != null && CanJoin.Equals(input.CanJoin))
                 ) &&
                 (
                     IsCompleted == input.IsCompleted ||
                     (IsCompleted != null && IsCompleted.Equals(input.IsCompleted))
                 ) &&
                 (
                     IsVisible == input.IsVisible ||
                     (IsVisible != null && IsVisible.Equals(input.IsVisible))
                 ) &&
                 (
                     DisplayLevel == input.DisplayLevel ||
                     (DisplayLevel.Equals(input.DisplayLevel))
                 ) &&
                 (
                     RecommendedLight == input.RecommendedLight ||
                     (RecommendedLight.Equals(input.RecommendedLight))
                 ) &&
                 (
                     DifficultyTier == input.DifficultyTier ||
                     (DifficultyTier != null && DifficultyTier.Equals(input.DifficultyTier))
                 ) &&
                 (
                     Challenges == input.Challenges ||
                     (Challenges != null && Challenges.SequenceEqual(input.Challenges))
                 ) &&
                 (
                     ModifierHashes == input.ModifierHashes ||
                     (ModifierHashes != null && ModifierHashes.SequenceEqual(input.ModifierHashes))
                 ) &&
                 (
                     BooleanActivityOptions == input.BooleanActivityOptions ||
                     (BooleanActivityOptions != null && BooleanActivityOptions.SequenceEqual(input.BooleanActivityOptions))
                 ) &&
                 (
                     LoadoutRequirementIndex == input.LoadoutRequirementIndex ||
                     (LoadoutRequirementIndex.Equals(input.LoadoutRequirementIndex))
                 ));
        }
예제 #28
0
파일: Editor.cs 프로젝트: pranart/FormTest
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //INPUTVIEW
            case nameof(Keyboard):
                return(this.Keyboard.ToString());

            //EDITOR
            case nameof(FontAttributes):
                return(this.FontAttributes.ToString());

            case nameof(FontFamily):
                return(this.FontFamily);

            case nameof(FontSize):
                return(this.FontSize.ToString());

            case nameof(Text):
                return(this.Text);

            case nameof(TextColor):
                return(this.TextColor.ToHex());

            default:
                return(string.Empty);
            }
        }
예제 #29
0
        private List <ConsoleDebuggerActionHook> GetActionHooks(int index, IEnumerable <Keyword> allKeywords)
        {
            var commands = new List <ConsoleDebuggerActionHook>()
            {
                new ConsoleDebuggerActionHook("find (.+)", "find X: use this to test a web element locator", input =>
                {
                    var arg    = ParseArguments(input, 1).First();
                    var script = $@"tagMatches(getExactMatches(""{arg}""));";
                    (Selenium.WebDriver).RunLibraryScript(script);
                    DontDoAnything(index);
                }),
                new ConsoleDebuggerActionHook("click (.+)", "click X: use this to click on element ad-hoc", input =>
                {
                    var arg   = ParseArguments(input, 1).First();
                    var click = new Click(arg);
                    ServiceLocator.Instance.Resolve(click);
                    Command.SelectedKeyword = click;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("isvisible (.+)", "isvisible X: checks visibility of text", input =>
                {
                    var arg       = ParseArguments(input, 1).First();
                    var isVisible = new IsVisible(arg)
                    {
                        Expect = true
                    };
                    ServiceLocator.Instance.Resolve(isVisible);
                    Command.SelectedKeyword = isVisible;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("fill (.+) (.+)", "fill X Y: use this to fill on element ad-hoc", input =>
                {
                    var args = ParseArguments(input, 2);
                    var fill = new Fill(args.First(), args.Last());
                    ServiceLocator.Instance.Resolve(fill);
                    Command.SelectedKeyword = fill;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("show", "show [left|right]: highlights buttons with their sort orders using a screen overlay", input =>
                {
                    var args = ParseArguments(input, 1);
                    var show = new Show(args.First());
                    ServiceLocator.Instance.Resolve(show);
                    Command.SelectedKeyword = show;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("goto (.+)", "goto X: use this to click on element ad-hoc", input =>
                {
                    var arg = ParseArguments(input, 1).First();
                    var go  = new GoToUrl(arg);
                    ServiceLocator.Instance.Resolve(go);
                    Command.SelectedKeyword = go;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("restart", "restart : go back to the beginning of the test", input =>
                {
                    Command.NextIndex = -1;
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("savehtml", "savehtml : save current page source to a new HTML file", input =>
                {
                    var save = new SaveHtml();
                    ServiceLocator.Instance.Resolve(save);
                    Command.SelectedKeyword = save;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("run ([0-9]*)", "run <N>: runs N steps", input =>
                {
                    var args2           = ParseArguments(input, 1);
                    Command.StopOnIndex = Math.Min(allKeywords.Count() - 2, index + 1 + int.Parse(args2.First()));
                    Command.StepThrough = false;
                }),
                new ConsoleDebuggerActionHook("run", "run : Run selected step", input => { Command.StepThrough = false; }),
                new ConsoleDebuggerActionHook("back ([0-9]*)", "back <N>: Return selection N steps back", input =>
                {
                    var args3         = ParseArguments(input, 1);
                    Command.NextIndex = Math.Max(-1, index - 1 - int.Parse(args3.First()));
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("back", "back : Return selection to previous step", input =>
                {
                    Command.NextIndex = Math.Max(-1, index - 2);
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("skip ([0-9]*)", "skip N : Skips N steps", input =>
                {
                    var args4         = ParseArguments(input, 1);
                    Command.NextIndex = Math.Min(allKeywords.Count() - 2, index - 1 + int.Parse(args4.First()));
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("skip", "skip : Skips one step", input => { Command.RunStep = false; }),
                new ConsoleDebuggerActionHook("stop", "stop : Stops the test", input =>
                {
                    Command.Break = true;
                    DontDoAnything(index);
                }),
                new ConsoleDebuggerActionHook("reload", "reload : re-reads all input files", input =>
                {
                    foreach (var dataAccess1 in Data.DataAccesses.OfType <FileObjectAccess>())
                    {
                        dataAccess1.ForceReload();
                    }
                    Command.Reload = true;
                    DontDoAnything(index);
                })
            };

            return(commands);
        }