本文整理汇总了C#中CharacterType类的典型用法代码示例。如果您正苦于以下问题:C# CharacterType类的具体用法?C# CharacterType怎么用?C# CharacterType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CharacterType类属于命名空间,在下文中一共展示了CharacterType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateStringTypeTests
public void GenerateStringTypeTests()
{
FastRandom fr = new FastRandom();
CharacterType[] types = new CharacterType[] { CharacterType.LowerCase, CharacterType.UpperCase, CharacterType.Numeric };
Func<char, bool>[] actions = new Func<char, bool>[] { Char.IsLower, Char.IsUpper, Char.IsNumber };
for(int i = 0; i < types.Length; i++)
{
for(int j = 0; j < 1000; j++)
{
var s = fr.NextString(5, types[i]);
Assert.Equal(5, s.Length);
foreach(var c in s)
{
Assert.True(actions[i](c));
}
}
}
{
var s = fr.NextString(5, CharacterType.Special);
Assert.Equal(5, s.Length);
foreach(var c in s)
{
Assert.True(FastRandom.SpecialCharacters.Contains(c));
}
}
}
示例2: OnTriggerExit
void OnTriggerExit(Collider other)
{
if (other.gameObject.CompareTag ("Player")) {
confirm.text = "";
selected = CharacterType.None;
}
}
示例3: OnTriggerEnter
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag ("Player")) {
tag = gameObject.tag;
switch(tag){
case ("AssassinPad"):
confirm.text = "Take the Path of the Assassin?\n (y)";
selected = CharacterType.Assassin;
Debug.Log (gameObject.tag);
break;
case ("WarriorPad"):
confirm.text = "Take the Path of the Warrior?\n (y)";
selected = CharacterType.Warrior;
Debug.Log (gameObject.tag);
break;
case ("RangerPad"):
confirm.text = "Take the Path of the Ranger?\n (y)";
selected = CharacterType.Ranger;
Debug.Log (gameObject.tag);
break;
case ("MagePad"):
confirm.text = "Take the Path of the Mage?\n (y)";
selected = CharacterType.Mage;
Debug.Log (gameObject.tag);
break;
}
//other.gameObject.SetActive(false);
//Debug.Log (gameObject);
//Debug.Log ("Entered pad Trigger");
}
}
示例4: Pool
public Pool(CharacterType ctype) {
switch (ctype) {
case CharacterType.PikeMan:
m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/pike_effect");
break;
}
}
示例5: add
/**
* Appends a new character to the end of the buffer.
*
* @param characterType
* the type of Arabic letter or Quranic symbol to append, such as
* <i>Alif</i> or <i>Ba</i>.
*/
public void add(CharacterType characterType)
{
// Check if the buffer is not large enough to support a new character.
if (characterCount >= characterCapacity)
{
// Copy the existing data into a new larger buffer.
int newCapacity = characterCapacity * 2;
byte[] newBuffer = new byte[newCapacity
* ByteFormat.CHARACTER_WIDTH];
Array.Copy(buffer, 0, newBuffer, 0, characterCapacity * ByteFormat.CHARACTER_WIDTH);
// Use the new buffer.
buffer = newBuffer;
characterCapacity = newCapacity;
}
// Add the character to the end of the buffer.
int offset = characterCount * ByteFormat.CHARACTER_WIDTH;
buffer[offset] = characterType != null ? (byte)characterType : ByteFormat.WHITESPACE;
buffer[offset + 1] = 0;
buffer[offset + 2] = 0;
// Increment character count.
characterCount++;
}
示例6: Draw
public static void Draw(ref System.Windows.Forms.PaintEventArgs e, CharacterType type, MovementWay way = MovementWay.Right)
{
switch (type)
{
case CharacterType.Packman:
e.Graphics.Clear(System.Drawing.SystemColors.Control);
e.Graphics.FillEllipse(System.Drawing.Brushes.Yellow, 0, 0, 20, 20);
e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(6, 7, 3, 3));
e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(12, 7, 3, 3));
e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(12, 7, 3, 3));
e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(8, 12, 6, 2));
break;
case CharacterType.Enemy:
e.Graphics.Clear(System.Drawing.SystemColors.Control);
e.Graphics.FillEllipse(System.Drawing.Brushes.Blue, new System.Drawing.Rectangle(0, 0, 20, 25));
e.Graphics.FillEllipse(System.Drawing.Brushes.LightYellow, new System.Drawing.Rectangle(4, 8, 3, 3));
e.Graphics.FillEllipse(System.Drawing.Brushes.LightYellow, new System.Drawing.Rectangle(13, 8, 3, 3));
e.Graphics.FillPolygon(System.Drawing.SystemBrushes.Control,
new System.Drawing.Point[] {
new System.Drawing.Point(1, 20),
new System.Drawing.Point(4, 15),
new System.Drawing.Point(7, 20),
new System.Drawing.Point(10, 15),
new System.Drawing.Point(13, 20),
new System.Drawing.Point(16, 15),
new System.Drawing.Point(19, 20)});
break;
}
}
示例7: SpawnCharacterForPlayer
void SpawnCharacterForPlayer(Player player, CharacterType type, GameObject spawnPoint)
{
Character newCharacter = (Instantiate(characterPrefab, spawnPoint.transform.position, Quaternion.identity) as GameObject).GetComponent<Character>();
newCharacter.player = player;
player.character = newCharacter;
newCharacter.InitializeWithType(type);
}
示例8: DrawTextBox
public IEnumerator DrawTextBox(string text, float duration, CharacterType Character)
{
switch (Character) {
case CharacterType.Kegan:
break;
case CharacterType.Klug:
break;
case CharacterType.Melonee:
ProfilePic.sprite = MeloneePic;
break;
case CharacterType.Brentt:
ProfilePic.sprite = BrenttPic;
break;
case CharacterType.Brandon:
ProfilePic.sprite = BrandonPic;
break;
case CharacterType.Chuck:
ProfilePic.sprite = ChuckPic;
Debug.Log("ASD");
break;
case CharacterType.Nyjel:
ProfilePic.sprite = NyjelPic;
break;
}
TextBoxText.text = text;
TextBox.SetActive (true);
yield return new WaitForSeconds(duration);
TextBox.SetActive (false);
}
示例9: EnemyCharacter
public EnemyCharacter(CharacterType characterType, MonsterController controller) {
this.characterType = characterType;
MovementSpeed = GameProperties.DEFAULT_ENEMY_SPEED;
this.controller = controller;
OnDeathAction += OnDeath;
SetupCharacter();
}
示例10: CharacterDefinition
/// <summary>
/// Initializes a new instance of the <see cref="CharacterDefinition"/> class.
/// Creates the animation and frame array and then reads character data from file to fill
/// all fields
/// </summary>
/// <param name="path">The path.</param>
public CharacterDefinition(String loadPath, CharacterType type)
{
Reset();
Path = loadPath;
Read();
CharType = (int)type;
}
示例11: Pool
public Pool(CharacterType ctype, PoolType ptype) {
switch (ptype) {
case PoolType.AttackEffectPool:
switch (ctype)
{
case CharacterType.PikeMan:
m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/pike_effect");
break;
case CharacterType.GunGirl:
m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/gungirl_effect");
break;
case CharacterType.SpiderQueen:
m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/SpiderQueen_effect");
break;
case CharacterType.Zako:
m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/Zako_effect");
break;
case CharacterType.ZakoFar:
m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/syuriken");
break;
}
break;
case PoolType.HitEffectPool:
break;
}
}
示例12: InstantiateCharacterTypeInScene
private void InstantiateCharacterTypeInScene(CharacterType characterType) {
Character characterPrefab = GetCharacter(characterType);
Character character = Instantiate(characterPrefab);
character.transform.parent = characterHolder;
character.transform.localPosition = Vector3.zero;
currentCharacter = character;
}
示例13: Player
protected Player(string name, int str, int dex, int vit, int intl, int strengthModifier, int dexterityModifier,
int vitalityModifier, int intelligenceModifier,
List<IItem> baseItems, CharacterType characterType)
: base(name)
{
this.Strength = str;
this.Dexterity = dex;
this.Vitality = vit;
this.Intelligence = intl;
this.StrengthModifier = strengthModifier;
this.DexterityModifier = dexterityModifier;
this.VitalityModifier = vitalityModifier;
this.IntelligenceModifier = intelligenceModifier;
Position = new Position();
this.Level = 1;
this.Cash = 500;
this.Inventory = new List<IItem>();
this.Equiped = new List<IItem>();
this.InitialItemEquip(baseItems);
//CalculateAttackPoints();
//CalculateDefencePoints();
this.CalculateHitPoints();
CurrentHitPoints = this.MaxHitPoints;
this.CharacterType = characterType;
}
示例14: CreateCharacter
public static Character CreateCharacter(CharacterType newCharacterType, Vector2 position, Tile CurrentTile)
{
Character newCharacter = null;
switch (newCharacterType)
{
case CharacterType.GRU:
newCharacter = CreateGru(position, CurrentTile);
break;
case CharacterType.MINION_BANANA:
newCharacter = CreateBananaMinion(position, CurrentTile);
break;
case CharacterType.POWERUP_MINION:
newCharacter = CreatePowerupMinion(position, CurrentTile);
break;
case CharacterType.POLICE_OFFICER:
newCharacter = CreatePoliceOfficer(position, CurrentTile);
break;
}
return newCharacter;
}
示例15: GetAttackEffectPoolByType
public static Pool GetAttackEffectPoolByType(CharacterType ctype) {
if (!AEPoolDic.ContainsKey(ctype)) {
Pool aePool = new Pool(ctype, Pool.PoolType.AttackEffectPool);
AEPoolDic.Add(ctype, aePool);
return aePool;
}
return AEPoolDic[ctype];
}