Skip to content

.NET class library for simulation of Orteil's Cookie Clicker

License

Notifications You must be signed in to change notification settings

Aurumaker72/CookieCore

Repository files navigation

CookieCore

.NET class library for simulation of Orteil's Cookie Clicker

🚀 Getting Started

Create a new project with your desired GUI framework or game engine.

Build the CookieCore solution, and add a reference to the CookieCore.Services, CookieCore.ViewModels, and CookieCore.Models assembly.

On startup, create a new instance of the MainViewModel class.

MainViewModel = new(timersService: new(), filesService: new(), ticksPerSecond: 60);

⚠️ Implementing ITimersService and IFilesService is required

1️⃣ XAML Binding

You can effortlessly bind to properties under the MainViewModel

<TextBlock Text="{Binding MainViewModel.GameViewModel.Cookies}"/>
<Button Command="{Binding MainViewModel.GameViewModel.ClickCookieCommand}"/>

2️⃣ Manual Subscriptions

Subscribe to the PropertyChanged event on any class you want, then update your view accordingly

MainViewModel.GameViewModel.PropertyChanged += delegate(object? sender, PropertyChangedEventArgs args)
{
    if (args.PropertyName == nameof(GameViewModel.Cookies))
    {
        // Update UI here...
    }
};

⚠️ Proper handling of changes in MainViewModel is required (binding cascade)

About

.NET class library for simulation of Orteil's Cookie Clicker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages