Skip to content

Instantly share code, notes, and snippets.

View moccy's full-sized avatar

Elliot Dewhurst moccy

  • Ipswich, Suffolk
View GitHub Profile
@moccy
moccy / functions.php
Created February 20, 2018 18:10
Product Attribute List Code
// Returns an array of product attributes, each with a name and an array of values.
public function get_attribute_list() {
// Assumes $this is a WC_Product object.
$attributes = $this->get_attributes();
$spec_items = array();
foreach ($attributes as $attribute) {
array_push($spec_items, array(
'name' => wc_attribute_label($attribute->get_name()),
'values' => $this->get_attribute_term_names($attribute)
));
#include "Blackboard.h"
Blackboard::Blackboard(const Blackboard * copy)
{
*this = *copy;
}
Blackboard& Blackboard::operator=(const Blackboard& copy) {
if (&copy == this) return *this;
@moccy
moccy / Game.cpp
Created January 14, 2017 16:24
Window reference not drawing
#include "Game.h"
Game::Game(const sf::RenderWindow& window) : mwindow(window)
{
if (!mapTexture.loadFromFile("Images/Map.png"))
{
std::cerr << "Error loading map" << std::endl;
std::cin.get();
}
else {