- 1945_Code_Package.zip
- 1945 Code Package
- 1945_Demo_Package.zip
- 1945_Demo_Package
- Game.icproj
- IceCream.dll
- IceCream1945.exe
- IceCream1945Content
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- Music
- Sounds
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
- 1945_demo_package-noexe.zip
- Game.icproj
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
- 1945_demo_package.zip
- Game.icproj
- IceCream.dll
- IceCream1945.exe
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
- 1945_Demo_Package-noexe.zip
- Game.icproj
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
|
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Xml.Serialization;
using System.Xml;
namespace IceCream
{
public static class IceCreamExtensions
{
#if WINDOWS
public static void AppendChildIfNotNull(this XmlNode node, XmlNode childNode)
{
if (childNode != null)
{
node.AppendChild(childNode);
}
}
#endif
public static Vector2 GetSide(this Vector2 vector2)
{
return new Vector2(-vector2.Y, vector2.X);
}
public static float Angle(this Vector2 vector2)
{
return (float)Math.Atan2((float)vector2.Y, (float)vector2.X);
}
public static Vector2 Size(this Texture2D tex)
{
return new Vector2(tex.Width, tex.Height);
}
public static Vector3 ToVector3(this Vector2 vector2)
{
Vector3 vector3 = new Vector3();
vector3.X = vector2.X;
vector3.Y = vector2.Y;
return vector3;
}
public static Vector2 ToVector2(this Vector3 vector3)
{
return new Vector2(vector3.X, vector3.Y);
}
/// <summary>
/// Checks if a float value is equal to another value within a given threshold limit, with extremes excluded
/// </summary>
/// <param name="comparisonValue">The value to compare to</param>
/// <param name="threshold">The thresold above and below the comparaison value</param>
/// <returns>True if the value is contained within (comparisonValue-threshold and comparisonValue+threshold)</returns>
public static bool IsWithinValue(this float value, float comparisonValue, float threshold)
{
if (value < comparisonValue + threshold && value > comparisonValue - threshold)
{
return true;
}
return false;
}
#if !REACH
/// <summary>
/// Returns true if the PlayerIndex is allowed to purchase content from the marketplace
/// </summary>
public static bool CanBuyGame(this PlayerIndex player)
{
Microsoft.Xna.Framework.GamerServices.SignedInGamer gamer = Microsoft.Xna.Framework.GamerServices.Gamer.SignedInGamers[player];
if (gamer == null)
{
return false;
}
return gamer.Privileges.AllowPurchaseContent;
}
#endif
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.