Skip to content

Instantly share code, notes, and snippets.

View ShirakawaYoshimaru's full-sized avatar

SLEKFjawefkjw ShirakawaYoshimaru

  • 東京あたり
View GitHub Profile
@ShirakawaYoshimaru
ShirakawaYoshimaru / init.sh
Created May 3, 2017 05:11
vagrantにphp7とapacheとcomposerを入れるbash
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo yum install -y --enablerepo=remi,remi-php70 php php-devel php-mbstring php-pdo php-xml php-zip
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
using UnityEngine;
using UnityEngine.UI;
using System;
public abstract class Factory
{
Action createEvent;
public void AddListenCreateEvent (Action action)
{
using UnityEngine;
using UnityEngine.UI;
using System;
public abstract class PlayerBase : MonoBehaviour
{
protected StateBase nowState;
public abstract void ModifyState (StateBase state);
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
new Human (new Speak ()).Hellow ();
@ShirakawaYoshimaru
ShirakawaYoshimaru / BridgeパターンBefore2
Last active June 11, 2016 07:13
実装クラスが増えると対応した機能クラスも増やす必要がある
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
new Human (new Speak ()).Hellow ();
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
new Human (new Speak ()).Hellow ();
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
Decoratable cake = new CreamDecorator (new ChocoDecorator (new CakeDecorator (new Cake ("スススススス"))));
using UnityEngine;
using UnityEngine.UI;
using System;
//使い方
public class TestScript : MonoBehaviour
{
public View view;
Data<int> score = new Data<int> ();
@ShirakawaYoshimaru
ShirakawaYoshimaru / Adapterパターン課題
Created June 10, 2016 17:38
Cubeを10個生成するCubeGeneraterクラスがある。Adapterパターンを使ってCubeを30個生成する機能を作成せよ
public class CubeGenerater
{
public void Make10 ()
{
for (int i = 0; i < 10; i++) {
var position = Vector3.right;
position.x *= i;
Generate (position);
}
}
using UnityEngine;
using System;
//使い方
public class TestScript : MonoBehaviour
{
void Start ()
{
var a = new GoodHellow1 ("いーちゃん", 20, "。戯言だけどね!");
a.VeryGoodHellow ();