Skip to content

Commit

Permalink
MalomAPI.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
ggevay committed May 16, 2023
1 parent 505e253 commit 2711438
Show file tree
Hide file tree
Showing 21 changed files with 745 additions and 9 deletions.
9 changes: 9 additions & 0 deletions Malom3/AboutBox.vb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@

Public NotInheritable Class AboutBox

Public Shared sing As AboutBox

Public Sub New()
sing = Me
' auto-generated:
' This call is required by the designer.
InitializeComponent()
End Sub

Private Sub AboutBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Set the title of the form.
Dim ApplicationTitle As String
Expand Down
3 changes: 3 additions & 0 deletions Malom3/Board.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
' along with this program. If not, see <http://www.gnu.org/licenses/>.


Imports System.Drawing
Imports System.Windows.Forms

Public Class Board
Inherits PictureBox
Private frm As FrmMain
Expand Down
15 changes: 14 additions & 1 deletion Malom3/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@


Imports System.Drawing
Imports System.Windows.Forms

Public Class FrmMain

Public Shared sing As FrmMain
Public _Board As New Board(Me)
Public Game As Game
Public Settings As New FrmSettings
Expand All @@ -43,6 +45,13 @@ Public Class FrmMain

Public PlayerTypeMenuItems As New List(Of ToolStripMenuItem)

Public Sub New()
sing = Me
' auto-generated:
' This call is required by the designer.
InitializeComponent()
End Sub

<System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute>
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Expand Down Expand Up @@ -437,7 +446,11 @@ Public Class FrmMain
End Try
End Sub
Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click
AboutBox.ShowDialog()
'AboutBox.ShowDialog()
If AboutBox.sing Is Nothing Then
Dim x = New AboutBox
End If
AboutBox.sing.ShowDialog()
End Sub


Expand Down
4 changes: 2 additions & 2 deletions Malom3/Malom3.vbproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<StartWorkingDirectory>D:\malom_data</StartWorkingDirectory>
<StartWorkingDirectory>C:\Users\Gabor\Desktop\Malom\Malom_Standard_Ultra-strong_1.1.0\Std_DD_89adjusted\</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<StartWorkingDirectory>d:\malom_data</StartWorkingDirectory>
<StartWorkingDirectory>C:\Users\Gabor\Desktop\Malom\Malom_Standard_Ultra-strong_1.1.0\Std_DD_89adjusted\</StartWorkingDirectory>
</PropertyGroup>
</Project>
17 changes: 16 additions & 1 deletion Malom3/PerfectPlayer.vb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Public Class Sectors
For wf = 0 To Rules.MaxKSZ
For bf = 0 To Rules.MaxKSZ
Dim fname = String.Format(Rules.VariantName & "_{0}_{1}_{2}_{3}.sec" & Constants.Fname_suffix, w, b, wf, bf)
'Console.WriteLine("Looking for database file " & fname)
Dim id As New id(w, b, wf, bf)
If File.Exists(fname) Then
sectors(id) = New Sector(id)
Expand Down Expand Up @@ -176,6 +177,20 @@ Public Class PerfectPlayer
Public MoveType As MoveType
Public WithTaking, OnlyTaking As Boolean 'A With-esben benne van a malombecsukas lepese is, az Only-sban pedig csak a levetel
Public TakeHon As Integer

Public Function ToBitBoard() As Integer
If OnlyTaking Then
Return 1 << TakeHon
End If
Dim ret As Integer = 1 << hov
If MoveType = MoveType.SlideMove Then
ret += 1 << hon
End If
If WithTaking Then
ret += 1 << TakeHon
End If
Return ret
End Function
End Structure

Private Function FutureKorongCount(s As GameState) As Integer
Expand Down Expand Up @@ -374,7 +389,7 @@ Public Class PerfectPlayer
End Function

Private Shared rnd As New Random()
Private Function ChooseRandom(Of T)(ByVal l As List(Of T)) As T
Public Function ChooseRandom(Of T)(ByVal l As List(Of T)) As T
Return l(rnd.Next(l.Count))
End Function

Expand Down
3 changes: 3 additions & 0 deletions Malom3/Rules.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Imports System.Windows.Forms

Module Rules
Public MillPos(,), StdLaskerMillPos(15, 2), MoraMillPos(19, 2) As Byte 'megadja az egyes StdLaskerMalomPozícióban részt vevő mezők sorszámát
Expand Down Expand Up @@ -210,6 +211,8 @@ Module Rules
End Function

Public Sub SetVariant()
' part of this is copy-pasted in MalomAPI

Select Case Wrappers.Constants.Variant
Case Wrappers.Constants.Variants.std
MillPos = StdLaskerMillPos
Expand Down
3 changes: 2 additions & 1 deletion Malom3/Settings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ Public Class FrmSettings
Main.AdjustStatusStrip1Visibility()
CalcNodeValues = ChkCalcNodeValues.Checked
ShowEv = ChkShowEv.Checked
FrmMain.LblEv.Visible = ChkShowEv.Checked
'FrmMain.LblEv.Visible = ChkShowEv.Checked
FrmMain.sing.LblEv.Visible = ChkShowEv.Checked
timelimit = UDIncTimeLimit.Value
Wrappers.gui_eval_elem2.ignore_DD = ChkIgnoreDD.Checked
End Sub
Expand Down
1 change: 1 addition & 0 deletions Malom3/UDP.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Imports System.Windows.Forms

Module UDP
Class UDPPlayer
Expand Down
Binary file added MalomAPI/Bitboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
164 changes: 164 additions & 0 deletions MalomAPI/MalomAPI.vbproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0F512A78-B6AF-40F9-93A6-AB72659A98DF}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>MalomAPI</RootNamespace>
<AssemblyName>MalomAPI</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>MalomAPI.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>MalomAPI.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Malom3\AboutBox.Designer.vb">
<Link>AboutBox.Designer.vb</Link>
</Compile>
<Compile Include="..\Malom3\AboutBox.vb">
<Link>AboutBox.vb</Link>
<SubType>Form</SubType>
</Compile>
<Compile Include="..\Malom3\Board.vb">
<Link>Board.vb</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Malom3\ComputerPlayer.vb">
<Link>ComputerPlayer.vb</Link>
</Compile>
<Compile Include="..\Malom3\Engine.vb">
<Link>Engine.vb</Link>
</Compile>
<Compile Include="..\Malom3\Main.Designer.vb">
<Link>Main.Designer.vb</Link>
</Compile>
<Compile Include="..\Malom3\Main.vb">
<Link>Main.vb</Link>
<SubType>Form</SubType>
</Compile>
<Compile Include="..\Malom3\Move.vb">
<Link>Move.vb</Link>
</Compile>
<Compile Include="..\Malom3\PerfectPlayer.vb">
<Link>PerfectPlayer.vb</Link>
</Compile>
<Compile Include="..\Malom3\Player.vb">
<Link>Player.vb</Link>
</Compile>
<Compile Include="..\Malom3\Rules.vb">
<Link>Rules.vb</Link>
</Compile>
<Compile Include="..\Malom3\Settings.Designer.vb">
<Link>Settings.Designer.vb</Link>
</Compile>
<Compile Include="..\Malom3\Settings.vb">
<Link>Settings.vb</Link>
<SubType>Form</SubType>
</Compile>
<Compile Include="..\Malom3\UDP.vb">
<Link>UDP.vb</Link>
</Compile>
<Compile Include="MalomSolutionAccess.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wrappers\Hash.vcxproj">
<Project>{d8fee320-54d4-4779-a9c0-f97521ace759}</Project>
<Name>Wrappers</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>
Loading

0 comments on commit 2711438

Please sign in to comment.