public int Compare(object x, object y) { CharacterProfile character = null; CharacterProfile profile2 = null; if (x is GPlayCharacterMenu) { character = ((GPlayCharacterMenu)x).Character; } else { character = x as CharacterProfile; } if (y is GPlayCharacterMenu) { profile2 = ((GPlayCharacterMenu)y).Character; } else { profile2 = y as CharacterProfile; } if (character == null) { return(1); } if (profile2 == null) { return(-1); } return(character.Index - profile2.Index); }
public void AddCharacter(CharacterProfile character) { CharacterProfile[] characters = this.m_Characters; this.m_Characters = new CharacterProfile[characters.Length + 1]; for (int i = 0; i < characters.Length; i++) { this.m_Characters[i] = characters[i]; } this.m_Characters[characters.Length] = character; }
public void CharacterList(PacketReader pvSrc) { int num = pvSrc.ReadByte(); for (int i = 0; i < 5; i++) { string name = pvSrc.ReadString(60); if (name.Length > 0) { CharacterProfile profile = null; for (int j = 0; (profile == null) && (j < this.m_Shard.Characters.Length); j++) { if (this.m_Shard.Characters[j].Index == i) { profile = this.m_Shard.Characters[j]; } } if (profile != null) { profile.Name = name; } else { this.m_Shard.AddCharacter(new CharacterProfile(this.m_Shard, name, i)); } } else { CharacterProfile character = null; for (int k = 0; (character == null) && (k < this.m_Shard.Characters.Length); k++) { if (this.m_Shard.Characters[k].Index == i) { character = this.m_Shard.Characters[k]; } } if (character != null) { this.m_Shard.RemoveCharacter(character); } } } Array.Sort(this.m_Shard.Characters, new CharacterComparer()); new Timer(new OnTick(this.Update_OnTick), 0, 1).Start(false); }
public void RemoveCharacter(CharacterProfile character) { CharacterProfile[] characters = this.m_Characters; int index = Array.IndexOf(characters, character); if (index != -1) { this.m_Characters = new CharacterProfile[characters.Length - 1]; for (int i = 0; i < index; i++) { this.m_Characters[i] = characters[i]; } for (int j = index; j < this.m_Characters.Length; j++) { this.m_Characters[j] = characters[j + 1]; } } }
public bool Contains(CharacterProfile character) { return (Array.IndexOf(this.m_Characters, character) >= 0); }
public GPlayCharacterMenu(CharacterProfile character) : base(character.Name) { this.m_Character = character; }
public bool Contains(CharacterProfile character) { return(Array.IndexOf(this.m_Characters, character) >= 0); }