mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-31 05:37:17 -05:00
More cleanup
This commit is contained in:
parent
ba6455317f
commit
d9582492a3
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Hi there.
|
||||
* Looking to register an object from Common into DI, are ya?
|
||||
* Well don't. Go to the Slack channel and talk about it there.
|
||||
* Well don't. Go to the Discord channel and talk about it there.
|
||||
* If you add an autofac module to this project, your PR will be
|
||||
* rejected.
|
||||
*/
|
@ -1,24 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// A callback that is executed the button is activated (clicked).
|
||||
/// </summary>
|
||||
public delegate void OnActivateDelegate();
|
||||
|
||||
/// <summary>
|
||||
/// A callback that is executed if the button is toggled.
|
||||
/// </summary>
|
||||
/// <param name="isToggled">When enabled, this is true, otherwise false</param>
|
||||
public delegate void OnToggleDelegate(bool isToggled);
|
||||
|
||||
/// <summary>
|
||||
/// Represents a visual button on the screen.
|
||||
/// </summary>
|
||||
public interface IButton : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Assigning a function to this property will cause that function to be called
|
||||
/// when a button is pressed.
|
||||
/// </summary>
|
||||
OnActivateDelegate OnActivate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If false, the button is visually darkened, and will ignore all user input.
|
||||
/// </summary>
|
||||
bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The position of the button on the screen.
|
||||
/// </summary>
|
||||
Point Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Assigning a function to this property will cause that function to be called
|
||||
/// when the button is toggled on or off.
|
||||
/// </summary>
|
||||
OnToggleDelegate OnToggle { get; set; }
|
||||
|
||||
string Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Allows the button to update its internal state.
|
||||
/// Call this in the Update method of your scene.
|
||||
/// </summary>
|
||||
void Update();
|
||||
|
||||
/// <summary>
|
||||
/// Renders the button to the screen.
|
||||
/// Call this in the render method of your scene.
|
||||
/// </summary>
|
||||
void Render();
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
|
@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenDiablo2.Common.Enums;
|
||||
using OpenDiablo2.Common.Enums;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
public delegate void OnKeyPressed(char charcode);
|
||||
|
||||
|
@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using OpenDiablo2.Common.Models;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenDiablo2.Common.Models;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
public interface IMouseInfoProvider
|
||||
{
|
||||
|
@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using OpenDiablo2.Common.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
public interface IRenderTarget
|
||||
{
|
||||
|
@ -1,12 +1,6 @@
|
||||
using OpenDiablo2.Common.Enums;
|
||||
using OpenDiablo2.Common.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,14 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenDiablo2.Common.Models;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// A utility class to make it easy to get specific types of resources from the data files in the game.
|
||||
/// </summary>
|
||||
public interface IResourceManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Get an <see cref="ImageSet" /> from the game's resources.
|
||||
/// </summary>
|
||||
/// <param name="resourcePath">The path to the ImageSet to grab.</param>
|
||||
/// <returns>The <see cref="ImageSet"/> that was requested. Throw an exception if not found.</returns>
|
||||
ImageSet GetImageSet(string resourcePath);
|
||||
MPQFont GetMPQFont(string resourcePath);
|
||||
MPQDS1 GetMPQDS1(string resourcePath, LevelPreset level, LevelDetail levelDetail, LevelType levelType);
|
||||
|
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
public interface ISceneManager
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using OpenDiablo2.Common.Models;
|
||||
using System;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenDiablo2.Common.Models;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
public interface ITextDictionary
|
||||
{
|
||||
|
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenDiablo2.Common.Interfaces
|
||||
{
|
||||
|
@ -1,14 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenDiablo2.Common;
|
||||
using OpenDiablo2.Common.Enums;
|
||||
using OpenDiablo2.Common.Interfaces;
|
||||
|
||||
namespace OpenDiablo2.Core.UI
|
||||
namespace OpenDiablo2.Core.UI
|
||||
{
|
||||
// TODO: Allow to set Minipanel.buttons.character.OnAction or similar for button delegates
|
||||
public sealed class MiniPanel : IMiniPanel
|
||||
|
@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenDiablo2.Common;
|
||||
using OpenDiablo2.Common.Attributes;
|
||||
using OpenDiablo2.Common.Enums;
|
||||
@ -163,23 +159,5 @@ namespace OpenDiablo2.Scenes
|
||||
{
|
||||
|
||||
}
|
||||
/*
|
||||
private void RedrawMap()
|
||||
{
|
||||
gameState.MapDirty = false;
|
||||
|
||||
testSprite = new ISprite[gameState.MapData.Width * gameState.MapData.Height];
|
||||
var idx = 0;
|
||||
for (int y = 0; y < gameState.MapData.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < gameState.MapData.Width; x++)
|
||||
{
|
||||
testSprite[idx] = renderWindow.GenerateMapCell(gameState.MapData, x, y, eRenderCellType.Floor, gameState.CurrentPalette);
|
||||
testSprite[idx].Location = new Point(((x - y) * 80) - 2900, ((x + y) * 40) - 1900);
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user