当前位置: 首页>>代码示例>>C#>>正文


C# IO.Equals方法代码示例

本文整理汇总了C#中IO.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# IO.Equals方法的具体用法?C# IO.Equals怎么用?C# IO.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IO的用法示例。


在下文中一共展示了IO.Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateWithIOEvent

        public override void UpdateWithIOEvent(IO.IOEvent ioEvent)
        {
            if (ioEvent.Equals(rightMousePress))
            {
                Vector2 sceenPosition = IOState.MouseScreenPosition();
                Company rightClickCompany = this.PlayerObject.ClickCompany(sceenPosition);

                if (rightClickCompany != null)
                {

                    new AddTransportVehicleToCompany(this.LocalPlayer, rightClickCompany, vehicle);
                    this.LocalPlayer.PopUIContext();
                    new CompanySelected(this.NextInStack, rightClickCompany);
                }
            }
            else if (ioEvent.Equals(leftMousePress))
            {
                this.LocalPlayer.PopUIContext();
                this.UpdateNextInStackIO(ioEvent);
            }
            else
            {
                this.UpdateNextInStackIO(ioEvent);
            }
        }
开发者ID:BenjaminAlexander,项目名称:materiel,代码行数:25,代码来源:TransportVehicleSelected.cs

示例2: UpdateWithIOEvent

        public override void UpdateWithIOEvent(IO.IOEvent ioEvent)
        {
            if (ioEvent.Equals(leftMousePress))
            {
                Vector2 sceenPosition = IOState.MouseScreenPosition();

                Company selectedCompany = this.PlayerObject.ClickCompany(sceenPosition);
                if (selectedCompany != null)
                {
                    new CompanySelected(this, selectedCompany);
                }
                else
                {
                    Vector2 worldPosition = this.Game.Camera.ScreenToWorldPosition(sceenPosition);

                    List<PhysicalObject> clickList = this.Game.GameObjectCollection.Tree.GetObjectsInCircle(worldPosition, 25f);
                    if (clickList.Count > 0)
                    {
                        if (clickList[0] is Base)
                        {
                            new BaseSelected(this, (Base)clickList[0]);
                        }
                        else if (clickList[0] is CombatVehicle)
                        {
                            CombatVehicle vic = (CombatVehicle)clickList[0];
                            if ((Company)vic.Company != null)
                            {
                                new CompanySelected(this, vic.Company);
                            }
                            else
                            {
                                new CombatVehicleSelected(this, vic);
                            }
                        }
                        else if (clickList[0] is Transport)
                        {
                            Transport vic = (Transport)clickList[0];
                            if ((Company)vic.Company != null)
                            {
                                new CompanySelected(this, vic.Company);
                            }
                            else
                            {
                                new TransportVehicleSelected(this, vic);

                            }
                        }
                    }
                }
            }
            else if (ioEvent.Equals(createCompany))
            {
                new CreateCompany(this.LocalPlayer);
            }
        }
开发者ID:BenjaminAlexander,项目名称:materiel,代码行数:55,代码来源:RootContext.cs

示例3: UpdateWithIOEvent

 public override void UpdateWithIOEvent(IO.IOEvent ioEvent)
 {
     if (ioEvent.Equals(constructCombat))
     {
         new BuildCombatVehicle(this.LocalPlayer, selectedBase);
     }
     else if (ioEvent.Equals(constructTransport))
     {
         new BuildTransport(this.LocalPlayer, selectedBase);
     }
     else if (ioEvent.Equals(leftMousePress))
     {
         this.LocalPlayer.PopUIContext();
         this.UpdateNextInStackIO(ioEvent);
     }
     else
     {
         this.UpdateNextInStackIO(ioEvent);
     }
 }
开发者ID:BenjaminAlexander,项目名称:materiel,代码行数:20,代码来源:BaseSelected.cs

示例4: UpdateWithIOEvent

        public override void UpdateWithIOEvent(IO.IOEvent ioEvent)
        {
            if (ioEvent.Equals(rightMousePress))
            {
                Vector2 sceenPosition = IOState.MouseScreenPosition();

                Vector2 worldPosition = this.Game.Camera.ScreenToWorldPosition(sceenPosition);
                List<PhysicalObject> clickList = this.Game.GameObjectCollection.Tree.GetObjectsInCircle(worldPosition, 25f);
                if (clickList.Count > 0)
                {
                    if (clickList[0] is Base)
                    {

                        new SetSupplyPoint(this.LocalPlayer, (Base)clickList[0], this.selectedCompany);
                        return;
                    }
                }
            }
            else if (ioEvent.Equals(ctrPress))
            {
                new SetCompanyPositionsContext(this);
                return;
            }
            else if (ioEvent.Equals(leftMousePress))
            {
                Vector2 sceenPosition = IOState.MouseScreenPosition();

                if (this.PlayerObject.ClickCompanyDelete(sceenPosition, this.selectedCompany))
                {
                    new DeleteCompany(this.LocalPlayer, selectedCompany);
                    this.LocalPlayer.PopUIContext();
                    return;
                }

                Vector2 worldPosition = this.Game.Camera.ScreenToWorldPosition(sceenPosition);

                List<PhysicalObject> clickList = this.Game.GameObjectCollection.Tree.GetObjectsInCircle(worldPosition, 25f);
                if (clickList.Count > 0)
                {
                    if (clickList[0] is Vehicle && (Company)((Vehicle)clickList[0]).Company == this.selectedCompany)
                    {

                        this.LocalPlayer.PopUIContext();
                        if (clickList[0] is CombatVehicle)
                        {
                            new CombatVehicleSelected(this.NextInStack, (CombatVehicle)clickList[0]);
                        }
                        else if(clickList[0] is Transport)
                        {
                            new TransportVehicleSelected(this.NextInStack, (Transport)clickList[0]);
                        }
                        return;
                    }
                }

                this.LocalPlayer.PopUIContext();
                this.UpdateNextInStackIO(ioEvent);
            }
            else
            {
                this.UpdateNextInStackIO(ioEvent);
            }
        }
开发者ID:BenjaminAlexander,项目名称:materiel,代码行数:63,代码来源:CompanySelected.cs


注:本文中的IO.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。