content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
using System;
using System.Activities.Statements;
using System.Threading;
using System.Windows;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Observer.WeakEventPattern
{
// an event subscription can lead to a memory
// leak if you hold on to it past the object's
// lifetime
// we... | __label__POS | 0.743136 |
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Observer.Interfaces
{
public class Event
{
}
public class FallsIllEvent : Event
{
public string Address;
}
public class Person : IObservable<Event... | __label__POS | 0.908185 |
/**
*
*/
package com.apress.demo.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.... | __label__POS | 0.673445 |
using System;
using System.Collections.Generic;
using System.Runtime.Remoting.Channels;
using NUnit.Framework;
namespace DotNetDesignPatternDemos.Behavioral.Observer
{
namespace Coding.Exercise
{
public class Game
{
public event EventHandler RatEnters, RatDies;
public event EventHandler<Rat> N... | __label__POS | 0.923623 |
using System;
using NUnit.Framework;
namespace DotNetDesignPatternDemos.Behavioral.Command
{
namespace Coding.Exercise
{
public class Command
{
public enum Action
{
Deposit,
Withdraw
}
public Action TheAction;
public int Amount;
public bool Success;
... | __label__POS | 0.870336 |
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.TemplateMethod
{
public abstract class Game
{
public void Run()
{
Start();
while (!HaveWinner)
TakeTurn();
WriteLine($"Player {WinningPlayer} wins.");
}
protected abstract void Start();
protec... | __label__POS | 0.788283 |
using System.Runtime.InteropServices;
using NUnit.Framework;
namespace DotNetDesignPatternDemos.Behavioral.TemplateMethod
{
namespace Coding.Exercise
{
public class Creature
{
public int Attack, Health;
public Creature(int attack, int health)
{
Attack = attack;
Health = ... | __label__POS | 0.882283 |
/**
*
*/
package com.apress.demo.controllers;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.... | __label__POS | 0.978979 |
using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Visitor.Acyclic
{
public interface IVisitor<TVisitable>
{
void Visit(TVisitable obj);
}
public interface IVisitor {} // marker interface
public abstract class ... | __label__POS | 0.797603 |
using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Visitor.ReflectiveExtension
{
using DictType = Dictionary<Type, Action<Expression, StringBuilder>>;
public abstract class Expression
{
}
public class DoubleExpressi... | __label__POS | 0.960411 |
package com.apress.demo.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.apress.demo.entities.User;
import com.apress.demo.exceptions.UserImportSe... | __label__POS | 0.903207 |
using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Visitor.Dynamic
{
public abstract class Expression
{
}
public class DoubleExpression : Expression
{
public double Value;
public DoubleExpression(double valu... | __label__POS | 0.990312 |
using System;
using System.Text;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Visitor.Intrusive
{
public abstract class Expression
{
// adding a new operation
public abstract void Print(StringBuilder sb);
}
public class DoubleExpression : Expression
{
private double... | __label__POS | 0.900317 |
using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Visitor.Reflective
{
using DictType = Dictionary<Type, Action<Expression, StringBuilder>>;
public abstract class Expression
{
}
public class DoubleExpression : Exp... | __label__POS | 0.942334 |
using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
namespace DotNetDesignPatternDemos.Behavioral.Visitor.Classic
{
public abstract class Expression
{
public abstract void Accept(IExpressionVisitor visitor);
}
public class DoubleExpression : Expression
{
... | __label__POS | 0.882138 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Stateless;
using static System.Console;
namespace DesignPatterns.Behavioral.State.Stateless
{
public enum Health
{
NonReproductive,
Pregnant,
Reproductive
}
public enum Activity
{
... | __label__POS | 0.848267 |
using NUnit.Framework;
namespace DotNetDesignPatternDemos.Behavioral.State
{
namespace Coding.Exercise
{
public class CombinationLock
{
private readonly int[] combination;
public CombinationLock(int [] combination)
{
this.combination = combination;
Reset();
}
... | __label__POS | 0.683021 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace DotNetDesignPatternDemos.Behavioral.State.Handmade
{
public enum State
{
OffHook,
Connecting,
Connected,
OnHold,
OnHook
}
public enum Trigger
{
CallDialed,
HungUp,
... | __label__POS | 0.930332 |
using System;
using System.Text;
namespace DotNetDesignPatternDemos.Behavioral.State
{
enum State
{
Locked,
Failed,
Unlocked
}
public class SwitchBasedDemo
{
static void Main(string[] args)
{
string code = "1234";
var state = State.Locked;
var entry = new StringBuilder... | __label__POS | 0.940488 |
using System;
using System.Activities.Statements;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DotNetDesignPatternDemos.Behavioral.State.Classic
{
public class Switch
{
public State State = new OffState();
public void On() { State.On(this... | __label__POS | 0.947791 |
<?php
// Illuminate\Contracts\Bus\Dispatcher
namespace Illuminate\Contracts\Bus;
interface Dispatcher
{
/**
* Dispatch a command to its appropriate handler.
*
* @param mixed $command
* @return mixed
*/
public function dispatch($command);
/**
* Dispatch a command to its appr... | __label__POS | 0.999841 |
// dll/database/migrations/{YOUR_TIMESTAMP}/_create_claim_table.php
<?php
...
class CreateClaimsTable extends Migration
{
Schema::create('claims', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer(‘status_id’)->unsigned();
$table->integer(‘provider_id’)->unsigned();
$table->i... | __label__POS | 0.829787 |
"use strict";
var powerupjs = (function (powerupjs) {
function GameStateManager_Singleton() {
this._gameStates = [];
this._currentGameState = null;
}
GameStateManager_Singleton.prototype.add = function (gamestate) {
this._gameStates.push(gamestate);
this._currentGameState ... | __label__POS | 0.95018 |
// ddl/app/Policies/ClaimPolicy.php
<?php
namespace App\Policies;
use App\User;
use App\Claim;
use Illuminate\Auth\Access\HandlesAuthorization;
class ClaimPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any Claim.
*
* @param \App\User $user
* @return mixed
*/
public fun... | __label__POS | 0.976415 |
<?php
namespace App\Http\Controllers;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Request;
use App\Http\Requests\UploadFileRequest;
use Illuminate\Support\Facades\Storage;
class UploadController extends Controller
{
/**
* This is the method that will simply list all the... | __label__POS | 0.615242 |
<?php
//namespace & use statements
class Order extends Model
{
//properties and method definitions
/**
* @param $sequence : The location of the order line in the array
*/
public function removeOrderLine($sequence)
{
if (isset($this->orderLines[$sequence])) {
$orderLine = $this->orderLines[$sequence];
... | __label__POS | 0.804396 |
<?php
namespace App\Providers;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
pro... | __label__POS | 0.828721 |
// ddl/src/Claim/Submission/Application/Providers/ClaimSubmissionProvider.php
<?php
namespace Claim\Submission\Application\Providers;
use Illuminate\Support\ServiceProvider;
class ClaimSubmissionProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
... | __label__POS | 0.99822 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._enemies = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.... | __label__POS | 0.830181 |
"use strict";
function PlayingState() {
powerupjs.IGameLoopObject.call(this);
this.currentLevelIndex = -1;
this.levels = [];
this.loadLevelsStatus();
this.loadLevels();
}
PlayingState.prototype = Object.create(powerupjs.IGameLoopObject.prototype);
Object.defineProperty(PlayingState.prototype, "... | __label__POS | 0.826897 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
"use strict";
function GameOverState() {
powerupjs.GameObjectList.call(this);
this.playingState = powerupjs.GameStateManager.get(ID.game_state_playing);
this.overlay = new powerupjs.SpriteGameObject(sprites.overlay_gameover, ID.layer_overlays);
this.overlay.position = this.overlay.screenCenter;
thi... | __label__POS | 0.741539 |
"use strict";
function LevelFinishedState() {
powerupjs.GameObjectList.call(this);
this.playingState = powerupjs.GameStateManager.get(ID.game_state_playing);
this.overlay = new powerupjs.SpriteGameObject(sprites.overlay_welldone, ID.layer_overlays);
this.overlay.position = this.overlay.screenCenter;
... | __label__POS | 0.735515 |
"use strict";
function GameStateManager_Singleton() {
this._gameStates = [];
this._currentGameState = null;
}
GameStateManager_Singleton.prototype.add = function (gamestate) {
this._gameStates.push(gamestate);
this._currentGameState = gamestate;
return this._gameStates.length - 1;
};
GameStateMan... | __label__POS | 0.978519 |
#include <cstdio>
#include <stack>
#include <vector>
#include <array>
#include <iostream>
using namespace std;
#include <boost/algorithm/string.hpp>
void stack_and_vector()
{
stack<int, vector<int>> s;
s.push(123);
int x = s.top();
s.pop();
}
class String
{
string s;
public:
String(const string& s) : s{s... | __label__POS | 0.974188 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.626629 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer, id) {
GameObject.call(this, layer, id);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});... | __label__POS | 0.918857 |
"use strict";
function PairList(nrPairs, layer, id) {
SpriteGameObject.call(this, sprites.frame_goal, layer, id);
this._pairs = [];
for (var i = 0; i < nrPairs; i++)
this._pairs.push(7);
this._pairSprite = new SpriteGameObject(sprites.penguin_pairs);
this._pairSprite.parent = this;
}
PairLi... | __label__POS | 0.648391 |
"use strict";
function PlayingState() {
IGameLoopObject.call(this);
this.currentLevelIndex = -1;
this.levels = [];
this.loadLevelsStatus();
this.loadLevels();
}
PlayingState.prototype = Object.create(IGameLoopObject.prototype);
Object.defineProperty(PlayingState.prototype, "currentLevel", {
... | __label__POS | 0.809163 |
"use strict";
function TitleMenuState(layer) {
GameObjectList.call(this, layer);
var background = new SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(background);
this.playButton = new Button(sprites.button_play, ID.layer_overlays);
this.playButton.position = new Vector2... | __label__POS | 0.79567 |
"use strict";
function OptionsMenuState(layer) {
GameObjectList.call(this, layer);
var background = new SpriteGameObject(sprites.background_options, ID.layer_background);
this.add(background);
var onOffLabel = new Label("Arial", "60px", ID.layer_overlays);
onOffLabel.text = "Hints";
onOffLabe... | __label__POS | 0.81686 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.901745 |
"use strict";
function GameStateManager_Singleton() {
this._gameStates = [];
this._currentGameState = null;
}
GameStateManager_Singleton.prototype.add = function (gamestate) {
this._gameStates.push(gamestate);
this._currentGameState = gamestate;
return this._gameStates.length - 1;
};
GameStateMan... | __label__POS | 0.944907 |
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <boost/lexical_cast.hpp>
using namespace std;
struct Journal
{
string title;
vector<string> entries;
explicit Journal(const string& title)
: title{title}
{
}
void add(const string& entry);
// persistence is a separ... | __label__POS | 0.858097 |
#include <string>
#include <iostream>
#include <functional>
using namespace std;
class MailService
{
class Email {
public:
string from, to, subject, body;
};
public:
class EmailBuilder{
Email& email;
public:
explicit EmailBuilder(Email &email) : email(email) {}
EmailBuilder& from(string from... | __label__POS | 0.989445 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.626629 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer, id) {
GameObject.call(this, layer, id);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});... | __label__POS | 0.918857 |
"use strict";
function TitleMenuState(layer) {
GameObjectList.call(this, layer);
this.add(new SpriteGameObject(sprites.background_title, ID.layer_background));
this.playButton = new Button(sprites.button_play, ID.layer_overlays);
this.playButton.position = new Vector2(415, 540);
this.add(this.pla... | __label__POS | 0.678482 |
"use strict";
function LevelMenuState(layer) {
GameObjectList.call(this, layer);
this.background = new SpriteGameObject(sprites.background_levelselect, ID.layer_background);
this.add(this.background);
this.back = new Button(sprites.button_back, ID.layer_overlays);
this.back.position = new Vector2... | __label__POS | 0.636406 |
"use strict";
function OptionsMenuState(layer) {
GameObjectList.call(this, layer);
var background = new SpriteGameObject(sprites.background_options, ID.layer_background);
this.add(background);
var onOffLabel = new Label("Arial", "60px", ID.layer_overlays);
onOffLabel.text = "Hints";
onOffLabe... | __label__POS | 0.81686 |
#include <iostream>
#include <string>
#include <vector>
#include <tuple>
using namespace std;
// A. High-level modules should not depend on low-level modules.
// Both should depend on abstractions.
// B. Abstractions should not depend on details.
// Details should depend on abstractions.
enum class Relationsh... | __label__POS | 0.743703 |
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <boost/lexical_cast.hpp>
#include <vector>
class Database
{
public:
virtual int get_population(const std::string& name) = 0;
};
class SingletonDatabase : public Database
{
SingletonDatabase()
{
std::cout << "Initia... | __label__POS | 0.984205 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.901745 |
#include <string>
#include <iostream>
#include <functional>
using namespace std;
class PersonBuilder;
class Person
{
public:
string name, position;
};
class PersonBuilder
{
protected:
Person person;
public:
[[nodiscard]] Person build() const {
return person;
}
};
//class PersonInfoBuilder : public Perso... | __label__POS | 0.998356 |
// Objects in a program should be replaceable with instances of their subtypes
// w/o altering the correctness of the program
#include <iostream>
class Rectangle
{
protected:
int width, height;
public:
Rectangle(const int width, const int height)
: width{width}, height{height} { }
int get_width() const { r... | __label__POS | 0.730649 |
#pragma once
#include "Material.h"
#include "SolidWall.h"
enum class WallType
{
basic,
main,
partition
};
class WallFactory
{
static std::vector<std::weak_ptr<Wall>> walls;
public:
static std::shared_ptr<SolidWall> create_main(Point2D start, Point2D end, int elevation, int height)
{
if (elevation < 0... | __label__POS | 0.956026 |
#pragma once
#include "Point2D.h"
class Wall
{
Point2D start, end;
int elevation;
int height;
//public:
protected:
Wall(const Point2D start, const Point2D end, const int elevation, const int height)
: start{start},
end{end},
elevation{elevation},
height{height}
{
}
// but now you ... | __label__POS | 0.667697 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.button_quit, ID.layer_overlays);
this._quitButton.position = ne... | __label__POS | 0.900691 |
"use strict";
function PlayingState() {
powerupjs.IGameLoopObject.call(this);
this.currentLevelIndex = -1;
this.levels = [];
this.loadLevelsStatus();
this.loadLevels();
}
PlayingState.prototype = Object.create(powerupjs.IGameLoopObject.prototype);
Object.defineProperty(PlayingState.prototype, "... | __label__POS | 0.879785 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer) {
GameObject.call(this, layer);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});
GameOb... | __label__POS | 0.940307 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._enemies = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.... | __label__POS | 0.926159 |
"use strict";
function PlayingState() {
powerupjs.IGameLoopObject.call(this);
this.currentLevelIndex = -1;
this.levels = [];
this.loadLevelsStatus();
this.loadLevels();
}
PlayingState.prototype = Object.create(powerupjs.IGameLoopObject.prototype);
Object.defineProperty(PlayingState.prototype, "... | __label__POS | 0.826897 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.626629 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer, id) {
GameObject.call(this, layer, id);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});... | __label__POS | 0.918857 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.901745 |
"use strict";
function PainterGameWorld() {
this.cannon = new Cannon();
this.ball = new Ball();
this.can1 = new PaintCan(450, Color.red);
this.can2 = new PaintCan(575, Color.green);
this.can3 = new PaintCan(700, Color.blue);
this.score = 0;
this.lives = 5;
}
PainterGameWorld.prototype.ha... | __label__POS | 0.769858 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._enemies = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.... | __label__POS | 0.871347 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>DOM Scripting: Web Design with JavaScript and the Document Object Model</title>
<link rel="stylesheet" type="text/css" media="screen" href="styles/basic.css" />
</head>
<body>
<div id="container">
<div... | __label__POS | 0.978835 |
"use strict";
function PainterGameWorld() {
this.cannon = new Cannon();
this.ball = new Ball();
this.can1 = new PaintCan(450, Color.red);
this.can2 = new PaintCan(575, Color.green);
this.can3 = new PaintCan(700, Color.blue);
this.lives = 5;
}
PainterGameWorld.prototype.handleInput = function... | __label__POS | 0.811947 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Jay Skript And The Domsters</title>
<script src="scripts/modernizr-1.6.min.js"></script>
<link rel="stylesheet" media="screen" href="styles/basic.css" />
</head>
<body>
<header>
<img src="images/logo.gif" alt="Jay Skript and the Domst... | __label__POS | 0.661777 |
"use strict";
function PainterGameWorld() {
this.cannon = new Cannon();
this.ball = new Ball();
this.can1 = new PaintCan(450, Color.red);
this.can2 = new PaintCan(575, Color.green);
this.can3 = new PaintCan(700, Color.blue);
this.score = 0;
this.lives = 5;
}
PainterGameWorld.prototype.ha... | __label__POS | 0.739547 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.847535 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer, id) {
GameObject.call(this, layer, id);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});... | __label__POS | 0.936535 |
"use strict";
function JewelJamGameWorld(layer, id) {
GameObjectList.call(this, layer, id);
// the title screen
var titleScreen = new SpriteGameObject(sprites.title, ID.layer_overlays_2, ID.title);
this.add(titleScreen);
// add a background sprite
var background = new SpriteGameObject(sprites... | __label__POS | 0.617963 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function handleTouchStart(evt) {
evt.preventDefault();
var touches = evt.changedTouches;
for (var i = 0; i < touches.length; i++) {
Touch._touches.push(touches[i]);
Touch._touchPresses.push(true);
}
}
function handleTouchMove(evt) {
evt.preventDefault();
var touch... | __label__POS | 0.798199 |
"use strict";
GameObjectList.prototype = Object.create(GameObject.prototype);
function GameObjectList(layer, id) {
GameObject.call(this, layer, id);
this._gameObjects = [];
}
Object.defineProperty(GameObjectList.prototype, "length", {
get: function () {
return this._gameObjects.length;
}
});... | __label__POS | 0.936535 |
"use strict";
function JewelJamGameWorld(layer, id) {
GameObjectList.call(this, layer, id);
// add a background sprite
this.add(new SpriteGameObject(sprites.background, ID.layer_background));
// add a score frame
var scoreFrame = new SpriteGameObject(sprites.frame_score, ID.layer_overlays);
s... | __label__POS | 0.795257 |
"use strict";
function Vector2(x, y) {
this.x = typeof x !== 'undefined' ? x : 0;
this.y = typeof y !== 'undefined' ? y : 0;
}
Object.defineProperty(Vector2, "zero",
{
get: function () {
return new Vector2();
}
});
Object.defineProperty(Vector2.prototype, "isZero",
{
... | __label__POS | 0.896437 |
"use strict";
function Level(levelIndex, id) {
powerupjs.GameObjectList.call(this, id);
this._levelIndex = levelIndex;
this._waterdrops = new powerupjs.GameObjectList(ID.layer_objects);
this._enemies = new powerupjs.GameObjectList(ID.layer_objects);
this._quitButton = new powerupjs.Button(sprites.... | __label__POS | 0.871347 |
"use strict";
function TitleMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
// the title screen
var titleScreen = new powerupjs.SpriteGameObject(sprites.background_title, ID.layer_background);
this.add(titleScreen);
// add a play button
this.playButton = new powerupjs.Button(sp... | __label__POS | 0.905293 |
"use strict";
function LevelMenuState(layer) {
powerupjs.GameObjectList.call(this, layer);
this.background = new powerupjs.SpriteGameObject(sprites.levelselect, ID.layer_background);
this.add(this.background);
this.back = new powerupjs.Button(sprites.button_back, ID.layer_overlays);
this.back.pos... | __label__POS | 0.713346 |
"use strict";
function PainterGameWorld() {
this.cannon = new Cannon();
this.ball = new Ball();
this.can1 = new PaintCan(450, Color.red);
this.can2 = new PaintCan(575, Color.green);
this.can3 = new PaintCan(700, Color.blue);
this.lives = 5;
}
PainterGameWorld.prototype.handleInput = function... | __label__POS | 0.892567 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.