This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy $(TargetPath) $(TargetDir)..\..\..\$(TargetFileName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RandomMng | |
{ | |
private static Random random = new Random(); | |
public static int GetRandomInt32(ICollection<int> coll) | |
{ | |
int ret; | |
do | |
{ | |
ret = random.Next(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool TryGetPlayerInfoByUserName(string userName, out PlayerInfo playerInfo) | |
{ | |
IEnumerable<PlayerInfo> infoQuery = | |
from info in _PlayerInfoDic.Values | |
where info.UserName == userName | |
select info; | |
if (0 != infoQuery.Count()) | |
{ | |
playerInfo = infoQuery.First(); | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static class ProtoChangeColorHandler | |
{ | |
private static readonly string[] c_KeyWords = | |
{ | |
"default", "enum", "message", "import", "group", "package", | |
"extend", "extensions", "to", "max", | |
"service", "rpc", "returns", | |
"true", "false", | |
"required", "optional", "repeated", | |
"double", "float", "int32", "int64", "uint32", "uint64", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 Google Inc. All rights reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ulong HexStringToUlong(this string str) | |
{ | |
return ulong.Parse(str, System.Globalization.NumberStyles.HexNumber); | |
} | |
[NotNull] | |
public static string UlongToHexString(this ulong num) | |
{ | |
return string.Format("{0:x}", num); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Data Matrix Rotating | |
/// </summary> | |
/// <param name="number">Original Data</param> | |
/// <returns>Four directions of the number, the original data in the final.</returns> | |
public static ulong[] GetRotatedNumbers(ulong number) | |
{ | |
ulong[] ulongs = new ulong[4]; | |
ulongs[3] = number; | |
for (int t = 0; t < 3; ++t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Data Matrix Matching Check | |
/// </summary> | |
/// <param name="u1"></param> | |
/// <param name="u2"></param> | |
/// <param name="num">Maxdiff</param> | |
public static bool Match(ulong u1, ulong u2, byte num) | |
{ | |
for (u1 ^= u2; 0 != u1 && 0 != num; num--) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static explicit operator UnityEngine.Vector3(NanoFramework.UnityForServer.DataStructure.Vector3 v) | |
{ | |
return new UnityEngine.Vector3(v.x, v.y, v.z); | |
} |