Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

st235/Yamblz.LightsOut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yamblz.LightsOut

Engine usage

Setup

  • First of all, you need to init the engine object. GameEngineProvider class permit you to engine core, for performance, use:
Engine engine = GameEngineProvider.getEngine();

Note: Engine is singleton object, that means, all next calls of getEngine will return the same engine object.

  • The next one step is to init Field class, by:
Field field = engine.obtainNewField(Size size);

Available Size classes:

  1. SquareSize (represent the square area, constructor takes one parameter)

Initialization finished

Note: unfinished initialization will crash your program with SessionNotObtainedException.

Available methods

The Engine interface

    Field obtainNewField(Size size);

    Field getOriginField();
    Field getPreviousField(int steps);

    Field clickCurrentField(Point point);
    int calculateCurrentScore();
  • getOriginField resets current matrix
  • getPreviousField moves your game board to counted steps back. To make single back movement call getPreviousField(1)
  • clickCurrentField obtain new field, by user click. Use with Click class.
  • calculateCurrentScore returns current score

Point

Point interface

    int getX();
    int getY();

There are a lot of point inherited classes. The most valuable is Click class.

public Click(int x, int y)

License

MIT License

Copyright (c) 2017 Alexander Dadukin, Irina Kravtsova, Alena Malchikhina, Denis Verentsov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages