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


C# GemType类代码示例

本文整理汇总了C#中GemType的典型用法代码示例。如果您正苦于以下问题:C# GemType类的具体用法?C# GemType怎么用?C# GemType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Gem

 public Gem(GemType t, int l, Vector2 p)
 {
     layer = l;
     position = p;
     type = t;
     collected = false;
 }
开发者ID:sjohnst1,项目名称:GeneticAIProject,代码行数:7,代码来源:Gem.cs

示例2: GetGemInfo

 public GemInfo GetGemInfo(GemType type)
 {
     foreach(var info in gemInfo) {
         if(info.type == type) {
             return info;
         }
     }
     return null;
 }
开发者ID:Jarisha,项目名称:Social-Slots,代码行数:9,代码来源:IconGenerator.cs

示例3: FindGemsOfType

 static int FindGemsOfType(GemType type, int[] adjustedSpin, List<GemLocation> gems)
 {
     var counter = 0;
     foreach(var gl in gems) {
         if(gl.type == type && gl.idx == adjustedSpin[gl.reel]) {
             counter++;
         }
     }
     return counter;
 }
开发者ID:Jarisha,项目名称:Social-Slots,代码行数:10,代码来源:DemoSpinner.cs

示例4: BaseJewel

        public BaseJewel( int itemID, Layer layer )
            : base(itemID)
        {
            m_AosAttributes = new AosAttributes( this );
            m_AosResistances = new AosElementAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses( this );
            m_Resource = CraftResource.Iron;
            m_GemType = GemType.None;

            Layer = layer;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:11,代码来源:BaseJewel.cs

示例5: CreateGem

    public GameObject CreateGem(GemType type)
    {
        var info = GetGemInfo(type);
        var toReturn = new GameObject(info.name);
        var mf = toReturn.AddComponent<MeshFilter>();
        mf.mesh = baseMesh;
        var mr = toReturn.AddComponent<MeshRenderer>();
        mr.material = info.material;
        toReturn.transform.localScale = info.scale;

        return toReturn;
    }
开发者ID:Jarisha,项目名称:Social-Slots,代码行数:12,代码来源:IconGenerator.cs

示例6: BaseJewel

        public BaseJewel( int itemID, Layer layer )
            : base(itemID)
        {
            m_AosAttributes = new AosAttributes( this );
            m_AosResistances = new AosElementAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses( this );
            m_Resource = CraftResource.Iron;
            m_GemType = GemType.None;

            Layer = layer;

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );
        }
开发者ID:Leodinas,项目名称:uolite,代码行数:13,代码来源:BaseJewel.cs

示例7: BaseJewel

        public BaseJewel(int itemID, Layer layer, JewelEffect effect, int minCharges, int maxCharges)
            : base(itemID)
        {
            m_AosAttributes = new AosAttributes( this );
            m_AosResistances = new AosElementAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses( this );
            m_Resource = CraftResource.Iron;
            m_GemType = GemType.None;
            m_IDList = new List<Mobile>();

            Layer = layer;
            Weight = 1.0;
            Effect = effect;
            Charges = Utility.RandomMinMax( minCharges, maxCharges );
            m_Identified = false;
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:16,代码来源:BaseJewel.cs

示例8: GetGemType

		public static string GetGemType( GemType type )
		{
			switch (type)
			{
				case GemType.StarSapphire: return "star sapphire";
				case GemType.Emerald: return "emerald";
				case GemType.Sapphire: return "sapphire";
				case GemType.Ruby: return "ruby";
				case GemType.Citrine: return "citrine";
				case GemType.Amethyst: return "amethyst";
				case GemType.Tourmaline: return "tourmaline";
				case GemType.Amber: return "amber";
				case GemType.Diamond: return "diamond";
				default: return "";
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:16,代码来源:BaseJewel.cs

示例9: AddJewelrySet

        public void AddJewelrySet( GemType gemType, Type itemType )
        {
            int offset = (int)gemType - 1;

            int index = AddCraft( typeof( GoldRing ), 1044049, 1044176 + offset, 41.8, 90.0, typeof( IronIngot ), 1044036, 1, 1044037 );
            AddRes( index, itemType, 1044231 + offset, 1, 1044240 );

            index = AddCraft( typeof( SilverBeadNecklace ), 1044049, 1044185 + offset, 42.0, 90.0, typeof( IronIngot ), 1044036, 1, 1044037 );
            AddRes( index, itemType, 1044231 + offset, 1, 1044240 );

            index = AddCraft( typeof( GoldNecklace ), 1044049, 1044194 + offset, 41.9, 90.0, typeof( IronIngot ), 1044036, 1, 1044037 );
            AddRes( index, itemType, 1044231 + offset, 1, 1044240 );

            index = AddCraft( typeof( GoldEarrings ), 1044049, 1044203 + offset, 48.4, 90.0, typeof( IronIngot ), 1044036, 1, 1044037 );
            AddRes( index, itemType, 1044231 + offset, 1, 1044240 );

            index = AddCraft( typeof( GoldBeadNecklace ), 1044049, 1044212 + offset, 41.8, 90.0, typeof( IronIngot ), 1044036, 1, 1044037 );
            AddRes( index, itemType, 1044231 + offset, 1, 1044240 );

            index = AddCraft( typeof( GoldBracelet ), 1044049, 1044221 + offset, 44.5, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
            AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:22,代码来源:DefTinkering.cs

示例10: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 6: m_OldJewel = reader.ReadBool(); goto case 5;
                case 5: m_Seal = reader.ReadString(); goto case 4;
                case 4:
                case 3:
                {
                    m_Crafter = reader.ReadMobile();
                    m_CraftersOriginalName = reader.ReadString();
                    m_Quality = (WeaponQuality)reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Resource = (CraftResource)reader.ReadEncodedInt();
                    m_GemType = (GemType)reader.ReadEncodedInt();

                    goto case 1;
                }
                case 1:
                {
                    m_AosAttributes = new AosAttributes( this, reader );
                    m_AosResistances = new AosElementAttributes( this, reader );
                    m_AosSkillBonuses = new AosSkillBonuses( this, reader );

                    if ( Core.AOS && Parent is Mobile )
                        m_AosSkillBonuses.AddTo( (Mobile)Parent );

                    int strBonus = m_AosAttributes.BonusStr;
                    int dexBonus = m_AosAttributes.BonusDex;
                    int intBonus = m_AosAttributes.BonusInt;

                    if ( Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
                    {
                        Mobile m = (Mobile)Parent;

                        string modName = Serial.ToString();

                        if ( strBonus != 0 )
                            m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

                        if ( dexBonus != 0 )
                            m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

                        if ( intBonus != 0 )
                            m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
                    }

                    if ( Parent is Mobile )
                        ((Mobile)Parent).CheckStatTimers();

                    break;
                }
                case 0:
                {
                    m_AosAttributes = new AosAttributes( this );
                    m_AosResistances = new AosElementAttributes( this );
                    m_AosSkillBonuses = new AosSkillBonuses( this );

                    break;
                }
            }

            if ( version < 2 )
            {
                m_Resource = CraftResource.Iron;
                m_GemType = GemType.None;
            }

            if( version < 4 )
                Hue = 0;

            if (!String.IsNullOrEmpty(m_Seal) && !Seals.Contains(m_Seal))
                Seals.Add(m_Seal);
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:81,代码来源:BaseJewel.cs

示例11: GetShareStatusAndCommentsCount

        public static async Task<ShareStatusAndCommentsCount> GetShareStatusAndCommentsCount(string gemId, GemType gemtype, string userId)
        {
            try
            {
                if (!CrossConnectivity.Current.IsConnected)
                {
                    return null;
                }

                var client = new System.Net.Http.HttpClient();
                client.DefaultRequestHeaders.Add("Post", "application/json");
                client.BaseAddress = new Uri(Constants.SERVICE_BASE_URL);
                string gemIdString = string.Empty;

                switch (gemtype)
                {
                    case GemType.Goal:
                        gemIdString = "&goal_id=";
                        break;
                    case GemType.Event:
                        gemIdString = "&event_id=";
                        break;
                    case GemType.Action:
                        gemIdString = "&goalaction_id=";
                        break;
                    case GemType.Emotion:
                        gemIdString = "&emotion_id=";
                        break;
                    default:
                        break;
                }

                string uriString = "api.php?action=sharestatus&user_id=" +userId+ gemIdString + gemId;

                var response = await client.GetAsync(uriString);

                if (response != null && response.StatusCode == HttpStatusCode.OK)
                {
                    var responseJson = response.Content.ReadAsStringAsync().Result;
                    var rootobject = JsonConvert.DeserializeObject<ShareStatusResult>(responseJson);
                    if (rootobject != null && rootobject.resultarray != null)
                    {
                        return rootobject.resultarray;
                    }
                }

            }
            catch (Exception ex)
            {
                var test = ex.Message;
            }

            return null;
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:54,代码来源:ServiceHelper.cs

示例12: DeleteMediaFromGem

        public static async Task<string> DeleteMediaFromGem(string gemId, GemType gemtype, string mediaName)
        {
            try
            {
                if (!CrossConnectivity.Current.IsConnected)
                {
                    return "404";
                }

                var client = new System.Net.Http.HttpClient();
                client.DefaultRequestHeaders.Add("Post", "application/json");
                client.BaseAddress = new Uri(Constants.SERVICE_BASE_URL);
                string gemIdString = string.Empty;

                switch (gemtype)
                {
                    case GemType.Goal:
                        gemIdString = "&goal_id=";
                        break;
                    case GemType.Event:
                        gemIdString = "&event_id=";
                        break;
                    case GemType.Action:
                        gemIdString = "&goalaction_id=";
                        break;
                    case GemType.Emotion:
                        gemIdString = "&emotion_id=";
                        break;
                    default:
                        break;
                }

                string uriString = "api.php?action=deletemedia"+ gemIdString + gemId+"&media_file=" + mediaName ;

                var response = await client.GetAsync(uriString);

                if (response != null && response.StatusCode == HttpStatusCode.OK)
                {
                    var responseJson = response.Content.ReadAsStringAsync().Result;
                    var rootobject = JsonConvert.DeserializeObject<CodeAndTextOnlyResponce>(responseJson);
                    if (rootobject != null && rootobject.code != null)
                    {
                        return rootobject.code;
                    }
                }

            }
            catch (Exception ex)
            {
                var test = ex.Message;
            }

            return "404";
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:54,代码来源:ServiceHelper.cs

示例13: AddToFavorite

        public static async Task<string> AddToFavorite(string userId, string gemId, GemType gemType)
        {
            if (!CrossConnectivity.Current.IsConnected)
            {
                return "404";
            }

            try
            {
                string result = String.Empty;
                var client = new HttpClient();
                client.Timeout = new TimeSpan(0, 15, 0);
                client.BaseAddress = new Uri(Constants.SERVICE_BASE_URL);
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "multipart/form-data");

                var url = "api.php?action=addtofavorite";

                MultipartFormDataContent content = new MultipartFormDataContent();

                content.Add(new StringContent(userId, Encoding.UTF8), "user_id");

                switch (gemType)
                {
                    case GemType.Goal:
                        content.Add(new StringContent(gemId, Encoding.UTF8), "goal_id");
                        break;
                    case GemType.Event:
                        content.Add(new StringContent(gemId, Encoding.UTF8), "event_id");
                        break;
                    case GemType.Action:
                        content.Add(new StringContent(gemId, Encoding.UTF8), "goalaction_id");
                        break;
                    case GemType.Emotion:
                        break;
                    default:
                        break;
                }

                HttpResponseMessage response = null;
                try
                {
                    response = await client.PostAsync(url, content);
                }
                catch (Exception ex)
                {
                    var test = ex.Message;
                }

                if (response != null && response.StatusCode == HttpStatusCode.OK)
                {
                    var eventsJson = response.Content.ReadAsStringAsync().Result;
                    var rootobject = JsonConvert.DeserializeObject<ResultJSon>(eventsJson);
                    if (rootobject.code != null)
                    {
                        client.Dispose();
                        return rootobject.code;
                    }
                }

                client.Dispose();
            }
            catch (Exception ex)
            {
                var test = ex.Message;
            }

            return "404";
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:68,代码来源:ServiceHelper.cs

示例14: GetComments

        public static async Task<List<Comment>> GetComments(string gemId, GemType gemType, bool isCommunityGem = false)
        {
            if (!CrossConnectivity.Current.IsConnected)
            {
                return null;
            }

            try
            {
                string result = String.Empty;
                var client = new HttpClient();
                client.Timeout = new TimeSpan(0, 15, 0);
                client.BaseAddress = new Uri(Constants.SERVICE_BASE_URL);
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "multipart/form-data");

                var url = "api.php?action=getcomments";

                MultipartFormDataContent content = new MultipartFormDataContent();


                switch (gemType)
                {
                    case GemType.Goal:
                        content.Add(new StringContent(gemId, Encoding.UTF8), "goal_id");
                        break;
                    case GemType.Event:
                        content.Add(new StringContent(gemId, Encoding.UTF8), "event_id");
                        break;
                    case GemType.Action:
                        content.Add(new StringContent(gemId, Encoding.UTF8), "goalaction_id");
                        break;
                    case GemType.Emotion:
                        break;
                    default:
                        break;
                }

                if (isCommunityGem)
                {
                    content.Add(new StringContent("1", Encoding.UTF8), "share_comment");
                }
                else
                {
                    content.Add(new StringContent("0", Encoding.UTF8), "share_comment");
                }

                HttpResponseMessage response = await client.PostAsync(url, content);

                if (response != null && response.StatusCode == HttpStatusCode.OK)
                {
                    var eventsJson = response.Content.ReadAsStringAsync().Result;
                    var rootobject = JsonConvert.DeserializeObject<GetCommentsResult>(eventsJson);
                    if (rootobject != null && rootobject.resultarray != null)
                    {
                        client.Dispose();
                        return rootobject.resultarray;
                    }
                }
                client.Dispose();
            }
            catch (Exception ex)
            {
                var test = ex.Message;
            }

            return null;
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:67,代码来源:ServiceHelper.cs

示例15: CommunityGems

		//public GemsDetailsPage(List<EventMedia> mediaArray, List<ActionMedia> actionMediaArray, string pageTitleVal, string titleVal, string desc, string Media, string NoMedia, string gemId, GemType gemType)
		public CommunityGems(DetailsPageModel model)
		{
			NavigationPage.SetHasNavigationBar(this, false);
			masterLayout = new CustomLayout();
			masterLayout.BackgroundColor = Color.FromRgb(244, 244, 244);
			masterScroll = new ScrollView();
			masterScroll.IsClippedToBounds = true;
			masterScroll.BackgroundColor = Color.FromRgb(244, 244, 244);
			progressBar = DependencyService.Get<IProgressBar>();
			currentUser = App.Settings.GetUser ();

			modelObject = model;
			CurrentGemId = model.gemId;
			CurrentGemType = model.gemType;

			cancelToken = new CancellationTokenSource ();
			mainTitleBar = new PurposeColorTitleBar(Color.FromRgb(8, 135, 224), "Purpose Color", Color.Black, "back", false);
			mainTitleBar.imageAreaTapGestureRecognizer.Tapped += OnImageAreaTapGestureRecognizerTapped;
			subTitleBar = new CommunityGemSubTitleBar(Constants.SUB_TITLE_BG_COLOR, Constants.COMMUNITY_GEMS, true);
			subTitleBar.myGemsTapRecognizer.Tapped += async (object sender, EventArgs e) => 
			{
				IProgressBar progress = DependencyService.Get<IProgressBar>();
				progress.ShowProgressbar( "Loading Mygems.." );

				CommunityGemsObject myGems = await ServiceHelper.GetMyGemsDetails();
				if( myGems != null )
				{
					//communityGems = null;
					Navigation.PushAsync( new MyGemsPage( myGems ) );
					myGemsCount = myGems.resultarray.Count;
				}

				progress.HideProgressbar();

				/*	masterStack.Children.Clear();
				masterStackLayout.Children.Clear();
				masterScroll.Content = null;

				RenderGems( communityGems );*/


			};
			subTitleBar.BackButtonTapRecognizer.Tapped += async (object sender, EventArgs e) =>
			{
				try
				{
					App.masterPage.IsPresented = !App.masterPage.IsPresented;
				}
				catch (Exception)
				{
				}
			};


			this.Appearing += OnAppearing;




			Label pageTitle = new Label();
			pageTitle.Text = model.pageTitleVal;
			pageTitle.TextColor = Color.Black;
			pageTitle.FontFamily = Constants.HELVERTICA_NEUE_LT_STD;
			pageTitle.FontAttributes = FontAttributes.Bold;
			pageTitle.WidthRequest = App.screenWidth * 80 / 100;
			pageTitle.HeightRequest = 50;
			pageTitle.XAlign = TextAlignment.Start;
			pageTitle.YAlign = TextAlignment.Start;
			pageTitle.FontSize = Device.OnPlatform(15, 20, 15);

			BoxView emptyLayout = new BoxView();
			emptyLayout.BackgroundColor = Color.Transparent;
			emptyLayout.WidthRequest = App.screenWidth * 90 / 100;
			emptyLayout.HeightRequest = 30;

			masterStackLayout = new StackLayout();
			masterStackLayout.Orientation = StackOrientation.Vertical;

			TapGestureRecognizer chatTap = new TapGestureRecognizer ();
			Image chat = new Image ();
			chat.Source = "chat.png";
			chat.Aspect = Aspect.Fill;
			chat.WidthRequest = App.screenWidth * 16 / 100;
			chat.HeightRequest = App.screenWidth * 12 / 100;
			chat.GestureRecognizers.Add ( chatTap );
			chatTap.Tapped += async (object sender, EventArgs e) => 
			{
				await Navigation.PushAsync( new ChatPage() );
			};

			masterLayout.AddChildToLayout(mainTitleBar, 0, 0);
			masterLayout.AddChildToLayout(chat, 80, 1);
			masterLayout.AddChildToLayout(subTitleBar, 0, Device.OnPlatform(9, 10, 10));
			masterLayout.AddChildToLayout(masterScroll, -1, 18);

			masterScroll.Scrolled += OnMasterScrollScrolled;

			Content = masterLayout;
		}
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:100,代码来源:CommunityGems.cs


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