/// <summary> /// Initialise the manaager with an initial portrait /// </summary> /// <param name="renderer">The rendering object</param> /// <param name="display">The display object</param> /// <param name="startID">The id of the starting portrait</param> /// <param name="startPortrait">The starting portrait object</param> public Manager(Renderer.Renderer renderer, Display.Display display, int startID, Portrait startPortrait) { _renderer = renderer; _display = display; _currentPortrait = startID; Portraits = new Dictionary <int, Portrait>(); AddPortrait(_currentPortrait, startPortrait); // Add the initial portrait to the list. startPortrait.SetManager(this); Portraits[_currentPortrait].SelectThisPortrait(); // Initialise the portrait }
/// <summary> /// Add a portrait to the dictionary /// </summary> /// <param name="id">The id for which kind of portrait it is</param> /// <param name="portrait">The actual portrait object you'd like to assign to that ID</param> public void AddPortrait(int id, Portrait portrait) { Portraits.Add(id, portrait); // Add it to the dictionary portrait.SetManager(this); // Set the portraits manager to this instance portrait.SetRenderOptions(_renderer, _display); // Set the portrait rendering options }