public static Entity Resolve(RealmManager manager, ushort id) { var node = manager.GameData.ObjectTypeToElement[id]; var cls = node.Element("Class"); if (cls == null) { throw new ArgumentException("Invalid XML Element, field class is missing"); } var type = cls.Value; switch (type) { case "Projectile": throw new Exception("Projectile should not instantiated using Entity.Resolve"); case "Sign": return(new Sign(manager, id)); case "Wall": case "DoubleWall": return(new Wall(manager, id, node)); case "ConnectedWall": case "CaveWall": return(new ConnectedObject(manager, id)); case "GameObject": case "CharacterChanger": case "MoneyChanger": case "NameChanger": return(new GameObject(manager, id, GameObject.GetHP(node), GameObject.GetStatic(node), false, true)); case "GuildRegister": case "GuildChronicle": case "GuildBoard": return(new GameObject(manager, id, null, false, false, false)); case "Container": return(new Container(manager, node)); case "Player": throw new Exception("Player should not instantiated using Entity.Resolve"); case "Character": //Other characters means enemy return(new Enemy(manager, id)); case "Portal": case "GuildHallPortal": return(new Portal(manager, id, null)); case "ClosedVaultChest": case "ClosedVaultChestGold": case "ClosedGiftChest": case "VaultChest": case "Merchant": return(new Merchant(manager, id)); case "GuildMerchant": return(new GuildMerchant(manager, id)); case "ArenaGuard": case "ArenaPortal": case "MysteryBoxGround": case "ReskinVendor": case "PetUpgrader": case "FortuneTeller": case "YardUpgrader": case "FortuneGround": case "QuestRewards": return(new GameObject(manager, id, null, true, false, false)); case "Pet": throw new Exception("Pets should not instantiated using Entity.Resolve"); default: Log.Warn("Not supported type: " + type); return(new Entity(manager, id)); } }
public Entity(RealmManager manager, ushort objType, bool interactive) : this(manager, objType, interactive, false) { }
public NetworkTicker(RealmManager manager) { Manager = manager; }
private Player playerOwner; //For Drakes public Entity(RealmManager manager, ushort objType) : this(manager, objType, true, false) { }
public ChatManager(RealmManager manager) { this.manager = manager; manager.InterServer.AddHandler <Message>(ISManager.CHAT, HandleChat); }