Skip to content

Instantly share code, notes, and snippets.

View mstefarov's full-sized avatar

Matvei Stefarov mstefarov

View GitHub Profile
// Copyright 2009, 2010, 2011 Matvei Stefarov <me@matvei.org>
using System;
using System.Linq;
using System.Net;
using fCraft.Events;
using JetBrains.Annotations;
namespace fCraft {
// TODO: Move logic to the relevant classes (PlayerInfo and IPBanList), when stable
public static class BanHelper {
public static void DoBan( [NotNull] Player player, string nameOrIP, [NotNull] string reason,
bool banIP, bool banAll, bool unban ) {
if( player == null ) throw new ArgumentNullException( "player" );
if( nameOrIP == null ) {
player.Message( "Please specify player name or IP to ban." );
return;
}
if( reason == null ) throw new ArgumentNullException( "reason" );
@mstefarov
mstefarov / gist:3768570
Created September 23, 2012 02:16 — forked from Jonty800/gist:3768171
4 scootiepie xxxxxxxxxx
#region Emotes
public struct EmoteData //Contains all data needed for the emotes. Emote is the trigger word,
//example (bullet). ID is the byte value of the char
{
public string Emote;
public byte ID;
}
//this list will be loaded with the list of emotes and their replacement values
static List<EmoteData> EmoteTriggers = null;
@mstefarov
mstefarov / test.cs
Created November 15, 2012 23:19 — forked from anonymous/test.cs
Newest Version of the harder one
using System;
namespace ConsoleApplication1 //this is from Deitel Exercises 6.9 – 6.12, 6.19, 6.21, 6.26
{ //To be specific, it's number 6.11
class Program
{
public static void Main( string[] args )
{
Console.WriteLine( "Enter however many integers out of which you would like the smallest divined:" );
int howManyInts = Convert.ToInt32( Console.ReadLine() );
@mstefarov
mstefarov / salarycounter.cs
Created November 30, 2012 04:01 — forked from anonymous/salarycounter.cs
Counts the amount of pay grades in each category.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
const double percentIncrease = 0.09;
@mstefarov
mstefarov / diceroll.cs
Created November 30, 2012 06:14 — forked from anonymous/diceroll.cs
Dicerolling!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DiceRoll
{
class Program
{
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace ShipGame
{
class MiniBoss : EnemyShip
{
@mstefarov
mstefarov / test.cs
Last active December 16, 2015 06:39 — forked from anonymous/test.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BucketSort
{
class Program
{
using System;
using System.Collections;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace fCraft {
public class BitMap3D : IEnumerable<Vector3I> {
const int BitCoordMask = 31;
readonly uint[] store;
using System;
using System.Collections;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace fCraft {
public class BitMap3D : IEnumerable<Vector3I> {
const int BitCoordMask = 31;
readonly uint[] store;