public Tool(Type uistateType) { userInterface = new UserInterface(); uistate = (UIModState)Activator.CreateInstance(uistateType, new object[] { userInterface }); uistate.Activate(); userInterface.SetState(uistate); }
// Type uistateType; public Tool(Type uistateType) { userInterface = new UserInterface(); // this.uistateType = uistateType; uistate = (UIModState)Activator.CreateInstance(uistateType, new object[] { userInterface }); //uistate = (UIModState)Activator.CreateInstance(uistateType); //uistate = new LootUI(userInterface); uistate.Activate(); //uistate.userInterface = userInterface; userInterface.SetState(uistate); }