This is just a swift package containing a collection of classes and structures I've found useful in various projects.
There are some tests you might use as examples, but for now, use at your own risk.
As of this writing, all "grids" are square grids.
GenericGridGame- This is the meat and potatoes of this package, basically a generic class meant to hold a multidimensional array of state structures representing a game's "model". (Note that,GridGameis a non-generic class that does the same thing, but assumes that your state is anInt. Warning that it might eventually be removed in favor ofGenericGridGame<Int>, which should be functionally identical.)Coordinateis a struct withxandyproperties that is heavily used throughout the API.Directionis an enumeration of the 8 grid-spaces around a given coordinate.ChessandTetromino- These are some structures meant to represent common grid movement or relative relationships between grid coordinates.UIView+GenericGrid.swiftandUIView+GenericGridInteraction.swift– These files containUIViewsubclasses specifically tailored to represent aGenericGridGame.
Everything should have at least some doc comments. Hopefully they're useful.
- some examples
- getting started instructions
- documentation
- version 0.1
This is almost entirely the product of Martin Grider futzing around.
- added
UIViewsubclasses (Feature parity with the original GGM? Not quite, I guess.) - added
Chess.swift - added a License, Creative Commons
- added a generic version of
GridGame - added
Tetromino.swift
This project was created.
A project called EasyGameView took some ideas from GGM and tried to apply them to SwiftUI. There was an example project for EasyGameView for this package also.
GGMSwift was created to (naively) port GGM to Swift.
Once upon a time, many of these same concepts existed in an Objective-C package called GenericGameModel.