more bomberman changes, doesn't work, not even close

This commit is contained in:
Master Kwoth 2016-04-01 23:52:13 +02:00
parent bdbb9d3b13
commit f6f75c6982
2 changed files with 63 additions and 5 deletions

View File

@ -1,18 +1,75 @@
using Discord.Commands; using Discord;
using Discord.Commands;
using NadekoBot.Commands; using NadekoBot.Commands;
using System; using System.Linq;
using static NadekoBot.Modules.Games.Commands.Bomberman;
namespace NadekoBot.Modules.Games.Commands namespace NadekoBot.Modules.Games.Commands
{ {
class Bomberman : DiscordCommand class Bomberman : DiscordCommand
{ {
public Field[,] board = new Field[15, 15];
public BombermanPlayer[] players = new BombermanPlayer[4];
public Channel gameChannel;
public Bomberman(DiscordModule module) : base(module) public Bomberman(DiscordModule module) : base(module)
{ {
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 15; j++)
{
board[i, j] = new Field();
}
}
NadekoBot.Client.MessageReceived += (s, e) =>
{
if (e.Channel != gameChannel)
return;
if (e.Message.Text == "a")
players.Where(p => p.User == e.User).FirstOrDefault()?.MoveLeft();
};
} }
internal override void Init(CommandGroupBuilder cgb) internal override void Init(CommandGroupBuilder cgb)
{ {
throw new NotImplementedException(); //cgb.CreateCommand(Module.Prefix + "bomb")
// .Description("Bomberman start")
// .Do(e =>
// {
// if (gameChannel != null)
// return;
// gameChannel = e.Channel;
// players[0] = new BombermanPlayer
// {
// User = e.User,
// };
// });
} }
public class BombermanPlayer
{
public User User;
public string Icon = "👳";
internal void MoveLeft()
{
}
}
}
internal class Field
{
public BombermanPlayer player = null;
public Field()
{
}
public override string ToString() => player?.Icon ?? "⬜";
} }
} }

View File

@ -130,6 +130,7 @@
<Compile Include="Classes\JSONModels\_JSONModels.cs" /> <Compile Include="Classes\JSONModels\_JSONModels.cs" />
<Compile Include="Classes\Leet.cs" /> <Compile Include="Classes\Leet.cs" />
<Compile Include="Classes\Music\MusicControls.cs" /> <Compile Include="Classes\Music\MusicControls.cs" />
<Compile Include="Classes\Music\PoopyBuffer.cs" />
<Compile Include="Classes\Music\Song.cs" /> <Compile Include="Classes\Music\Song.cs" />
<Compile Include="Classes\Music\StreamRequest.cs" /> <Compile Include="Classes\Music\StreamRequest.cs" />
<Compile Include="Classes\Music\SoundCloud.cs" /> <Compile Include="Classes\Music\SoundCloud.cs" />
@ -186,7 +187,8 @@
<Compile Include="Modules\Conversations.cs" /> <Compile Include="Modules\Conversations.cs" />
<Compile Include="Modules\DiscordModule.cs" /> <Compile Include="Modules\DiscordModule.cs" />
<Compile Include="Modules\Gambling\GamblingModule.cs" /> <Compile Include="Modules\Gambling\GamblingModule.cs" />
<Compile Include="Modules\Games.cs" /> <Compile Include="Modules\Games\Commands\Bomberman.cs" />
<Compile Include="Modules\Games\GamesModule.cs" />
<Compile Include="Modules\Help.cs" /> <Compile Include="Modules\Help.cs" />
<Compile Include="Modules\Music.cs" /> <Compile Include="Modules\Music.cs" />
<Compile Include="Commands\PollCommand.cs" /> <Compile Include="Commands\PollCommand.cs" />
@ -478,7 +480,6 @@
<Name>Discord.Net</Name> <Name>Discord.Net</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.