Skip to content

Instantly share code, notes, and snippets.

View raveneer's full-sized avatar
🏠
Working from home

jooho kim raveneer

🏠
Working from home
View GitHub Profile
@raveneer
raveneer / test.cs
Created January 2, 2018 08:25
simple gist test
using Entitas;
using UnityEngine;
using Zenject;
public class DummyGameController : MonoBehaviour
{
Systems _systems;
[Inject] private Contexts _contexts;
[Inject] private DummySystem _dummySystem;
#include <iostream>
using namespace std;
void main()
{
cout << "이런거..?" << endl;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Entitas;
public class MakeRandomDamageables : IInitializeSystem
{
private Contexts _contexts;
public MakeRandomDamageables(Contexts contexts)
@raveneer
raveneer / FireDamageSystem.CS
Created January 4, 2018 13:55
simple Entitas damage system
using Entitas;
using UnityEngine;
public class FireDamageSystem : IExecuteSystem
{
readonly IGroup<GameEntity> _haveFireEntities;
public FireDamageSystem(Contexts contexts)
{
_haveFireEntities = contexts.game.GetGroup(GameMatcher.Fire);
@raveneer
raveneer / AnonymousClassJsonParser.cs
Created January 6, 2018 13:17
클래스명을 알고 있는 임의의 클래스를 Json을 이용해서 직렬/역직렬화 하는 클래스. Json.Net을 사용한다.
using System;
using System.Diagnostics;
using Newtonsoft.Json;
using NUnit.Framework;
namespace UnitTestProject
{
internal class Test_ComponentGenerator
{
[Test]
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Entitas;
using UnityEngine.Tilemaps;
using Zenject;
/// <summary>
@raveneer
raveneer / Test_AgingSystem.CS
Created February 7, 2018 04:46
example of Tribes.Tests
using System.Collections.Generic;
using NUnit.Framework;
using Zenject;
using Entitas;
namespace UnitTestProject.EntitasSystems
{
class Test_AgingSystem : ZenjectUnitTestFixture
{
[Inject] private Contexts _contexts;
@raveneer
raveneer / Test_MapSpec.CS
Created February 7, 2018 04:48
example of Tribes.Test
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using NUnit.Framework;
using Zenject;
namespace UnitTestProject
{
[TestFixture]
[Category("")]
@raveneer
raveneer / C# Extensions
Last active October 17, 2018 03:12
VK's C# Extensions
/// <summary>
/// split string with chunkSize, discard remainings
/// </summary>
public static class StringExtension
{
public static IEnumerable<string> Split(this string str, int chunkSize)
{
return Enumerable.Range(0, str.Length / chunkSize)
.Select(i => str.Substring(i * chunkSize, chunkSize));
}