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


C# MusicName类代码示例

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


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

示例1: Deserialize

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

			int version = reader.ReadEncodedInt();
			
			switch ( version )
			{
				case 1:
				{
					m_Music = (MusicName) reader.ReadInt();
					break;
				}
			}
			
			if ( version == 0 ) // Music wasn't serialized in version 0, pick a new track of random rarity
			{
				DawnsMusicRarity rarity;
				double rand = Utility.RandomDouble();
				
				if ( rand < 0.025 )
					rarity = DawnsMusicRarity.Rare;
				else if ( rand < 0.225 )
					rarity = DawnsMusicRarity.Uncommon;
				else
					rarity = DawnsMusicRarity.Common;
				
				m_Music = DawnsMusicBox.RandomTrack( rarity );
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:30,代码来源:DawnsMusicGear.cs

示例2: Deserialize

 public override void Deserialize(GenericReader reader)
 {
     base.Deserialize(reader);
     int version = reader.ReadInt();
     m_Track = reader.ReadInt();
     m_Song = (MusicName)reader.ReadInt();
 }
开发者ID:greeduomacro,项目名称:annox,代码行数:7,代码来源:MusicBoxTrack.cs

示例3: TrackInfo

 public TrackInfo(int duration, int label, MusicName name, TrackRarity rarity)
 {
     this.m_Duration = duration;
     this.m_Label = label;
     this.m_Name = name;
     this.m_Rarity = rarity;
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:TrackInfo.cs

示例4: DawnsMusicGear

        public DawnsMusicGear(MusicName music)
            : base(0x1053)
        {
            this.m_Music = music;

            this.Weight = 1.0;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:DawnsMusicGear.cs

示例5: MusicBoxGears

		public MusicBoxGears( MusicName music ) : base( 0x1053 )
		{
			m_Music = music;
			Weight = 1.0;

			ItemValue = ItemValue.Rare;
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:7,代码来源:MusicBoxGears.cs

示例6: DawnsMusicBox

 public DawnsMusicBox() : base( 0x2AF9 )
 {
     Weight = 1.0;
     
     m_Tracks = new List<MusicName>();
     m_ActualSong = MusicName.Invalid;
     
     while( Tracks.Count < 4 )
     	AddSong( TrackInfo.RandomSong( TrackRarity.Common ) );
 }
开发者ID:PepeBiondi,项目名称:runsa,代码行数:10,代码来源:DawnsMusicBox.cs

示例7: Deserialize

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

			int version = reader.ReadInt();

			switch( version ) {
				case 6: {
						_minZ = reader.ReadInt();
						_maxZ = reader.ReadInt();

						goto case 5;
					}
				case 5: {
						m_EditAccessLevel = (AccessLevel)reader.ReadInt();

						goto case 4;
					}
				case 4: {
						m_RegionArea = ReadRect3DArray( reader );

						m_Flags = (RegionFlag)reader.ReadInt();

						m_RestrictedSpells = ReadBitArray( reader );
						m_RestrictedSkills = ReadBitArray( reader );

						m_Active = reader.ReadBool();

						m_RegionName = reader.ReadString();
						m_RegionPriority = reader.ReadInt();
						m_Music = (MusicName)reader.ReadInt();
						m_PlayerLogoutDelay = reader.ReadTimeSpan();
						m_LightLevel = reader.ReadInt();

						if( version <= 4 ) {
							reader.ReadMap();
							reader.ReadPoint3D();
							reader.ReadMap();
							reader.ReadPoint3D();
						}

						break;
					}
				case 3: //pre-RunUO 2.0
					{
						m_LightLevel = reader.ReadInt();
						goto case 2;
					}
				case 2: {
						m_Music = (MusicName)reader.ReadInt();
						goto case 1;
					}
				case 1: {
						List<Rectangle2D> rects2d = ReadRect2DArray( reader );
						foreach( Rectangle2D rect in rects2d ) {
							Rectangle3D newrect = Server.Region.ConvertTo3D( rect );
							DoChooseArea( null, this.Map, newrect.Start, newrect.End, this );
						}

						m_RegionPriority = reader.ReadInt();
						m_PlayerLogoutDelay = reader.ReadTimeSpan();

						m_RestrictedSpells = ReadBitArray( reader );
						m_RestrictedSkills = ReadBitArray( reader );

						m_Flags = (RegionFlag)reader.ReadInt();

						m_RegionName = reader.ReadString();
						break;
					}
				case 0: {
						List<Rectangle2D> rects2d = ReadRect2DArray( reader );
						foreach( Rectangle2D rect in rects2d ) {
							Rectangle3D newrect = Server.Region.ConvertTo3D( rect );
							DoChooseArea( null, this.Map, newrect.Start, newrect.End, this );
						}

						m_RestrictedSpells = ReadBitArray( reader );
						m_RestrictedSkills = ReadBitArray( reader );

						m_Flags = (RegionFlag)reader.ReadInt();

						m_RegionName = reader.ReadString();
						break;
					}
			}

			m_AllControls.Add( this );

			if( RegionNameTaken( m_RegionName ) )
				m_RegionName = FindNewName( m_RegionName );

			UpdateRegion();
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:93,代码来源:RegionControl.cs

示例8: GetInfo

		public static DawnsMusicInfo GetInfo( MusicName name )
		{
			if ( m_Info.ContainsKey( name ) )
				return m_Info[ name ];

			return null;
		}
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:7,代码来源:DawnsMusicBox.cs

示例9: Deserialize


//.........这里部分代码省略.........
                    {
                        AllowPvP = reader.ReadBool();
                        goto case 6;
                    }
                case 6:
                    {
                        AllowTrade = reader.ReadBool();
                        goto case 5;
                    }
                case 5:
                    {
                        CanUsePotHeal = reader.ReadBool();
                        CanUsePotMana = reader.ReadBool();
                        CanUsePotStam = reader.ReadBool();
                        CanUsePotShrink = reader.ReadBool();
                        CanCutCorpse = reader.ReadBool();
                        HasAttackPenalty = reader.ReadBool();
                        goto case 4;
                    }
                // New RunUO 2.0 Version (case 4)
                case 4:
                {
                    m_RegionArea = ReadRect3DArray(reader);
                    
                    m_Flags = (RegionFlag)reader.ReadInt();

                    m_RestrictedSpells = ReadBitArray(reader);
                    m_RestrictedSkills = ReadBitArray(reader);

                    m_Active = reader.ReadBool();

                    m_RegionName = reader.ReadString();
                    m_RegionPriority = reader.ReadInt();
                    m_Music = (MusicName)reader.ReadInt();
                    m_PlayerLogoutDelay = reader.ReadTimeSpan();
                    m_LightLevel = reader.ReadInt();

                    m_MoveNPCToMap = reader.ReadMap();
                    m_MoveNPCToLoc = reader.ReadPoint3D();
                    m_MovePlayerToMap = reader.ReadMap();
                    m_MovePlayerToLoc = reader.ReadPoint3D();

                    break;
                }

                // Old RunUO 1.0 Version (cases 3-0)
                case 3:
                {
                    m_LightLevel = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Music = (MusicName)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    List<Rectangle2D> rects2d = ReadRect2DArray(reader);
                    foreach (Rectangle2D rect in rects2d)
                    {
                        Rectangle3D newrect = Server.Region.ConvertTo3D(rect);
                        DoChooseArea(null, Map, newrect.Start, newrect.End, this);
                    }

                    m_RegionPriority = reader.ReadInt();
开发者ID:FreeReign,项目名称:imaginenation,代码行数:67,代码来源:RegionControl.cs

示例10: PlayMusic

 public PlayMusic( MusicName name )
     : base(0x6D, 3)
 {
     m_Stream.Write( (short)name );
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:5,代码来源:Packets.cs

示例11: MusicBoxGears

 public MusicBoxGears(MusicName music)
     : base(0x1053)
 {
     this.m_Music = music;
     this.Weight = 1.0;
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:6,代码来源:MusicBoxGears.cs

示例12: DawnsMusicGear

		public DawnsMusicGear( MusicName music ) : base( 0x1053 )
		{
			m_Music = music;

			Weight = 1.0;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:6,代码来源:DawnsMusicGear.cs

示例13: Deserialize

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

            /*int version = */
            reader.ReadInt();

            m_Music = (MusicName) reader.ReadInt();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:9,代码来源:MusicBoxGears.cs

示例14: RegionControl

		public RegionControl(Rectangle2D rect)
			: base(3026)
		{
			Coords = new ArrayList();
			InnBounds = new ArrayList();
			RestrictedTypes = new ArrayList();

			Coords.Add(rect);

			m_RestrictedSpells = new BitArray(SpellRegistry.Types.Length);
			m_RestrictedSkills = new BitArray(SkillInfo.Table.Length);

			Visible = false;
			Movable = false;
			Enabled = true;
			Name = "Region Controller";
			m_RegionName = "Custom Region";
			m_RestrictedMagicMsg = null;
			m_Priority = CustomRegionPriority.HighPriority;
			m_Music = MusicName.Invalid;
			UpdateRegion();
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:22,代码来源:RegionStone.cs

示例15: AddSong

		public bool AddSong( MusicName song )
		{
			if( m_Tracks.Contains( song ) )
			{
				return false;
			}
			else
			{
				m_Tracks.Add( song );
				return true;
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:12,代码来源:DawnsMusicBox.cs


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