2017 © Pedro Peláez
 

library cgi-calc

image

tmilos/cgi-calc

  • Tuesday, April 5, 2016
  • by tmilos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CGI Calc

Casual Gaming Infrastructure - Calc PHP library., (*1)

License Build Status Coverage Status Scrutinizer Code Quality, (*2)

Point

$point = new Point(10, 10);
print $point->getX();
print $point->getY();
$leftPoint = $point->left();
$otherPoint = $point->move(new Point(2, 3));

PointSet

$set = new PointSet([new Point(10, 10), new Point(20, 20)]);
$set[new Point(10, 10)] = 'something';
$set->contains(new Point(10, 10)); // true
print $set[new Point(10, 10)]; // something

$other = new PointSet([new Point(10, 10), new Point(0, 0)]);
$unionSet = $set->union($other);
$intersectionSet = $set->intersect($other);
$differenceSet = $set->diff($other);

Field Producers

$rectangularProducer = new RectangularFromTwoPoints(new Point(0,0), new Point(3, 2), function (Point $point) {
    // value provider for the points of the generated rectangular
    return sprintf("%d : %d", $point->getX(), $point->getY());
});
$rect = $rectangularProducer->produce();
$rectangularProducer = new RectangularFromTwoPoints(new Point(2,3), 10, 8);
$rect = $rectangularProducer->produce();
$circleProducer = new CircularCenterRadius(new Point(10,10), 8);
$circle = $circleProducer->produce();

License

Copyright Milos Tomic. This package is licensed under MIT, for details check the LICENSE file., (*3)

The Versions

05/04 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.5.1

 

The Development Requires

05/04 2016

0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.5.1

 

The Development Requires