本文整理汇总了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 );
}
}
示例2: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_Track = reader.ReadInt();
m_Song = (MusicName)reader.ReadInt();
}
示例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;
}
示例4: DawnsMusicGear
public DawnsMusicGear(MusicName music)
: base(0x1053)
{
this.m_Music = music;
this.Weight = 1.0;
}
示例5: MusicBoxGears
public MusicBoxGears( MusicName music ) : base( 0x1053 )
{
m_Music = music;
Weight = 1.0;
ItemValue = ItemValue.Rare;
}
示例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 ) );
}
示例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();
}
示例8: GetInfo
public static DawnsMusicInfo GetInfo( MusicName name )
{
if ( m_Info.ContainsKey( name ) )
return m_Info[ name ];
return null;
}
示例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();
示例10: PlayMusic
public PlayMusic( MusicName name )
: base(0x6D, 3)
{
m_Stream.Write( (short)name );
}
示例11: MusicBoxGears
public MusicBoxGears(MusicName music)
: base(0x1053)
{
this.m_Music = music;
this.Weight = 1.0;
}
示例12: DawnsMusicGear
public DawnsMusicGear( MusicName music ) : base( 0x1053 )
{
m_Music = music;
Weight = 1.0;
}
示例13: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
/*int version = */
reader.ReadInt();
m_Music = (MusicName) reader.ReadInt();
}
示例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();
}
示例15: AddSong
public bool AddSong( MusicName song )
{
if( m_Tracks.Contains( song ) )
{
return false;
}
else
{
m_Tracks.Add( song );
return true;
}
}