• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MusicName类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CloneFromRegionObject

		public void CloneFromRegionObject(Region r, bool loadedFromXML)
		{
			if (r != null)
			{
				//Clear flags before copy
				m_Flags = RegionFlag.None;

				// if we have a custom region, get this special bits
				if (r is CustomRegion)
					DupeCustomBits(r);

				if (r.Coords != null && r.Coords.Count > 0)
				{
					m_Coords.Clear();
					ArrayList c = r.Coords;

					for (int i = 0; i < c.Count; i++)
					{
						if (c[i] is Rectangle2D)
							m_Coords.Add((Rectangle2D)c[i]);
						//plasma: add missing 3d rects lol!
						if (c[i] is Rectangle3D)
							m_Coords.Add((Rectangle3D)c[i]);
					}
				}

				if (r.InnBounds != null && r.InnBounds.Count > 0)
				{
					m_InnBounds.Clear();
					ArrayList c = r.InnBounds;

					for (int i = 0; i < c.Count; i++)
					{
						if (c[i] is Rectangle2D)
							m_InnBounds.Add((Rectangle2D)c[i]);
						if (c[i] is Rectangle3D)
							m_InnBounds.Add((Rectangle3D)c[i]);
					}
				}

				//default these to true for non custom regions
				this.SetFlag(RegionFlag.CanUsePotions, true);
				this.SetFlag(RegionFlag.CanRessurect, true);
				this.SetFlag(RegionFlag.CanUseStuckMenu, true);
				this.SetFlag(RegionFlag.IsHouseRegion, r is HouseRegion);
				this.SetFlag(RegionFlag.AllowTravelSpellsInRegion, !IsFeluccaDungeon(r,loadedFromXML) && !(r is AngelIsland || r.Name.Equals("AngelIsland"))) ;
				//set guards and murder zone
				this.SetFlag(RegionFlag.IsGuarded, IsGuardedRegion(r,loadedFromXML));
				this.SetFlag(RegionFlag.NoMurderCounts, r.IsNoMurderZone);
				//Non custom regions only have a static InnLogoutDelay
				this.m_InnLogoutDelay = Region.InnLogoutDelay;
				//Blank the restricted spells / skills
				this.m_RestrictedSpells = new BitArray(SpellRegistry.Types.Length);
				this.m_RestrictedSkills = new BitArray(SkillInfo.Table.Length);

				//Assign generic props						
				this.m_Priority = MapPriority(r.Priority);
				this.m_Music = r.Music;
				this.SetFlag(RegionFlag.Music, (r.Music != MusicName.Invalid));
				this.m_RegionName = r.Name;
				this.m_TargetMap = r.Map;

				// LightLevel - defualts to 0, use -1 for region to inherit and use light level/cycle across the world.            
				if (this.m_LightLevel <= 0)
					this.m_LightLevel = -1;

				// Dungeon - Setting to True will set the regions light level to that of the dungon light level, has no other effects.
				this.SetFlag(RegionFlag.IsDungeon, IsFeluccaDungeon(r,loadedFromXML));
				this.m_GoLocation = r.GoLocation;
				this.m_MaxZ = r.MaxZ;
				this.m_MinZ = r.MinZ;

				//Plasma:  Felucca dungeons and AI need recall and gate OFF!
				if (IsFeluccaDungeon(r, loadedFromXML) || r is AngelIsland || r.Name.Equals("AngelIsland"))
				{
					NoGateInto = true;
					NoRecallInto = true;
				}

				UpdateRegion();
				this.SendMessage(String.Format("Region cloned from '" + r.Name + "'."));
			}
			else
			{
				this.SendMessage(String.Format("No region by the name '" + r.Name + "' found."));
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:87,代码来源:RegionStone.cs


示例17: DupeCustomBits

		private void DupeCustomBits(Region r)
		{
			//pla: replicate custom region
			if (r is CustomRegion)
			{
				RegionControl rc = (r as CustomRegion).GetRegionControler();

				if (rc != null)
				{
					//copy all the flags and restricted stuff
					this.m_Flags = rc.m_Flags;
					this.m_RestrictedSpells = new BitArray(rc.m_RestrictedSpells);
					this.m_RestrictedSkills = new BitArray(rc.m_RestrictedSkills);
					this.m_RestrictedMagicMsg = rc.m_RestrictedMagicMsg;
					this.m_InnLogoutDelay = rc.InnLogoutDelay;
					this.m_IOBAlignment = rc.IOBAlign;
					this.m_MaxFollowers = rc.MaxFollowerSlots;
					this.m_Music = r.Music;
					this.SetFlag(RegionFlag.Music, (r.Music != MusicName.Invalid));

					if (rc.LightLevel > 0)
						this.m_LightLevel = rc.LightLevel;

					this.m_Types.Clear();
					if (rc.m_Types != null && rc.m_Types.Count > 0)
					{
						ArrayList t = rc.m_Types;
						for (int i = 0; i < rc.m_Types.Count; ++i)
							if (t[i] is string)
								this.m_Types.Add((string)t[i]);
					}
				}
				else
				{
					this.SendMessage(String.Format("Region controller for custom region '" + r.Name + "' could not be found.\n\rCustom properties and flags have not been cloned successfully"));
				}
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:38,代码来源:RegionStone.cs


示例18: Deserialize

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

			int version = reader.ReadInt();

			switch (version)
			{
				case 14:
					{
						//version 14
						m_Coords=ReadRect3DArray(reader);
						m_InnBounds=ReadRect3DArray(reader);
						goto case 13;
					}
				case 13:
					{
						m_TargetMap = reader.ReadMap();
						m_GoLocation = reader.ReadPoint3D();
						m_MinZ = reader.ReadInt();
						m_MaxZ = reader.ReadInt();
						goto case 12;
					}
				case 12:
					{
						m_Enabled = reader.ReadBool();
						goto case 11;
					}
				case 11:
					{
						int size = reader.ReadInt();
						m_Types = new ArrayList(size);

						for (int i = 0; i < size; ++i)
						{
							string typeName = reader.ReadString();
							m_Types.Add(typeName);

						}
						goto case 10;
					}

				case 10:
					{
						m_MaxFollowers = reader.ReadInt();
						goto case 9;
					}
				case 9:
					{
						m_RestrictedMagicMsg = reader.ReadString();
						goto case 8;
					}
				case 8:
					{
						m_Music = (MusicName)reader.ReadInt();
						goto case 7;
					}

				case 7:
					{
						if (m_InnBounds == null)
						{
							m_InnBounds = ReadRect2DArray(reader);
						}
						else
						{
							m_InnBounds.AddRange(ReadRect2DArray(reader));
						}
						m_InnLogoutDelay = reader.ReadTimeSpan();

						goto case 6;
					}
				case 6:
					{
						m_PlayerLogoutDelay = reader.ReadTimeSpan();
						goto case 5;
					}
				case 5:
					{
						if (version < 13)
						{	// converted to a flag
							bool m_IsDungeon = (bool)reader.ReadBool();
							IsDungeon = m_IsDungeon;
						}
						goto case 4;
					}
				case 4:
					{
						m_IOBAlignment = (IOBAlignment)reader.ReadInt();
						goto case 3;
					}

				case 3:
					{
						m_LightLevel = reader.ReadInt();
						goto case 2;
					}
				case 2:
					{
						goto case 1;
//.........这里部分代码省略.........
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:RegionStone.cs


示例19: Deserialize

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

            int version = reader.ReadInt();

            Point3D customGoLoc = new Point3D(0,0,0);
            switch (version)
            {
            //---------------------------- Solaris Battlegrounds addition (3/3) begin ----------------------------------------------------

            /*  This allows region controllers to be used to define "battlegrounds" where player versus player combat is completely no-holds-barred.
            There is no notoriety problems like criminal/murder status, and is intended for PVP tourneys or all-around-PVP fun.

            */
                case 6:		//case 6 - added battlegrounds flag to serialized data
                {
                    _Battlegrounds = reader.ReadBool();
                    goto case 5;
                }
            //--------------------------- Solaris Battlegrounds addition (3/3) end ------------------------------------------------------
                // New RunUO 2.0 Version (case 5 and 4)
                case 5:
                {
                    customGoLoc = reader.ReadPoint3D();
                    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();

                    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, 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();
                    if (NoPlayerCorpses)
                    {
                        DeleteNPCCorpse = true;
                        DeletePlayerCorpse = true;
                    }
                    if (NoItemDrop)
                    {
                        NoPlayerItemDrop = true;
                        NoNPCItemDrop = true;
                    }
                    // Invert because of change from "Cannot" to "Can"
                    if (CanLootOwnCorpse)
                    {
                        CanLootOwnCorpse = false;
                    }
                    if (CanEnter)
                    {
                        CanEnter = false;
                    }

                    m_RegionName = reader.ReadString();
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:divinity,代码行数:101,代码来源:RegionControl.cs


示例20: Deserialize

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

            int version = reader.ReadInt();

            switch ( version )
            {
                case 3:
                {
                    m_LightLevel = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Music = (MusicName)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    Coords = ReadRect2DArray( reader );
                    m_Priority = (CustomRegionPriority) 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:
                {
                    Coords = new ArrayList();

                    Coords.Add( reader.ReadRect2D() );
                    m_RestrictedSpells = ReadBitArray( reader );
                    m_RestrictedSkills = ReadBitArray( reader );

                    m_Flags = (RegionFlag)reader.ReadInt();

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

            UpdateRegion();
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:49,代码来源:RegionStone.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MusicPlayer类代码示例发布时间:2022-05-24
下一篇:
C# MusicClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap