private void EvCreateActor(object sender, KeyEventArgs e) //Заменяемая в будущем штука, вызывающая осздание { ActorID ID = 0; Pos MSelect; switch (e.Code)// свич надо менять на что-то другое, поэтому он отдельно от следующего { case Keyboard.Key.Num1: ID = ActorID.Chestnut; break; case Keyboard.Key.Num9: ID = ActorID.Carrot; break; case Keyboard.Key.Num5: ID = ActorID.Rabbit; break; case Keyboard.Key.Num6: ID = ActorID.Wolf; break; case Keyboard.Key.Num7: ID = ActorID.Deer; break; default: return; } if (ID != 0 && MyMap.GetMouseCelPos2(win, MyCam, out MSelect, out _)) { CreateActor(MSelect, ID); } }
public Actor(Pos Envpos, Vector2f GlCoordinate) { Anim.GlCoord = GlCoordinate; ID = ActorID.Zero; Location = Envpos; Game.EvTick += EvTick; }
public void Clear() { if (ActorID != null) { ActorID.Clear(); } QingkungID = 0; }
public override HashEntry[] GetServiceInfo() { return(new[] { new HashEntry("IpAddrs", ServerInfo.IPAggregateString), new HashEntry("Role", (int)Role), new HashEntry("ActorID", ActorID.ToString()), new HashEntry("MQTopic", MQTopic), }); }
public void Clear() { MonsterID = 0; if (ActorID != null) { ActorID.Clear(); } if (Pos != null) { Pos.Clear(); } }
public void Clear() { if (ActorID != null) { ActorID.Clear(); } if (Pos != null) { Pos.Clear(); } ActorType = 0; Type = 0; }
public void Win_MouseButtonPressed(object sender, MouseButtonEventArgs e) { Cell Ocell = null; switch (e.Button) { case Mouse.Button.Left: Vector2i cdMse = Mouse.GetPosition(win); if (cdMse.X > 0 && cdMse.X < btnw * 5 && cdMse.Y < Configuration.VideoHigh && cdMse.Y > Configuration.VideoHigh - btnh * 4) { int CurX = cdMse.X / btnw; int CurY = (int)(cdMse.Y - Configuration.VideoHigh + btnh * 4) / btnh; if (CurX >= 0 && CurX < 5 && CurY >= 0 && CurY < 4) { cract = MasUI[CurY, CurX].ID; System.Console.WriteLine(cract); } Console.WriteLine($"CurX = {CurX} CurY = {CurY}"); } else { if (GetCell(out Pos _, out Ocell)) { act = Ocell.LAnimal; } else { //Console.WriteLine("Достало"); act = null; } } break; case Mouse.Button.Right: if (GetCell(out _, out Ocell)) { act = Ocell.LEnvir; } break; case Mouse.Button.Middle: act = null; Pos A; if (GetCell(out A, out Ocell)) { MyText2 = new Text(A.ToString(), MyFont); } break; } }
public override int GetHashCode() { int hash = 1; if (GcNID != 0UL) { hash ^= GcNID.GetHashCode(); } if (ActorID != 0) { hash ^= ActorID.GetHashCode(); } if (Nickname.Length != 0) { hash ^= Nickname.GetHashCode(); } if (Avatar.Length != 0) { hash ^= Avatar.GetHashCode(); } if (Gender != 0) { hash ^= Gender.GetHashCode(); } if (Money != 0) { hash ^= Money.GetHashCode(); } if (Diamoned != 0) { hash ^= Diamoned.GetHashCode(); } if (Rank != 0) { hash ^= Rank.GetHashCode(); } if (Exp != 0) { hash ^= Exp.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void Clear() { if (ActorID != null) { ActorID.Clear(); } if (Pos != null) { Pos.Clear(); } ActorType = 0; if (Toward != null) { Toward.Clear(); } if (TargetActorID != null) { TargetActorID.Clear(); } }
public void Clear() { if (ActorID != null) { ActorID.Clear(); } if (RoleAttr != null) { for (int i = 0; i < RoleAttr.Count; ++i) { RoleAttr[i].Clear(); ReturnRoleAttrElement(RoleAttr[i]); } RoleAttr.Clear(); } if (OtherView != null) { OtherView.Clear(); } if (FactionID != null) { FactionID.Clear(); } }
public Data(ActorID key) { idKey = key; }
public Bullet(Vector2 position, float rotation, Vector2 scale, ActorID ID) : base(position, rotation) { Speed = 2000; this.ID = ID; SetScale(scale.X, scale.Y); }
public void SetActor(Comment comment) { _actorID = (ActorID)Enum.Parse(typeof(ActorID), comment.CommentText); }
private bool CreateActor(Pos EnvPos, ActorID ID) { if (MyMap.MCell[EnvPos.X, EnvPos.Y].LEnvir == null) { Envir env = null; switch (ID) { case ActorID.Chestnut: env = new Envirs.Chestnut(EnvPos, MyMap.MCell[EnvPos.X, EnvPos.Y].GlCoord); break; case ActorID.Carrot: env = new Envirs.Carrot(EnvPos, MyMap.MCell[EnvPos.X, EnvPos.Y].GlCoord); break; } if (env != null) { if (env.GetCanPlace(MyMap.MCell[EnvPos.X, EnvPos.Y].ID, MyMap.MCell[EnvPos.X, EnvPos.Y].LAnimal)) { Envirs.Add(env); MyMap.AddEnvir(env, EnvPos); env.IGetCell += MyMap.GetCellP; env.IDeath += Delete; return(true); } else { env.Dispose(); } } } if (MyMap.MCell[EnvPos.X, EnvPos.Y].LAnimal == null) { Animal anim = null; switch (ID) { case ActorID.Rabbit: anim = new Animals.Rabbit(EnvPos, MyMap.MCell[EnvPos.X, EnvPos.Y].GlCoord); break; case ActorID.Wolf: anim = new Animals.Wolf(EnvPos, MyMap.MCell[EnvPos.X, EnvPos.Y].GlCoord); break; case ActorID.Deer: anim = new Animals.Deer(EnvPos, MyMap.MCell[EnvPos.X, EnvPos.Y].GlCoord); break; } if (anim != null) { if (anim.GetCanPlace(MyMap.MCell[EnvPos.X, EnvPos.Y].ID, MyMap.MCell[EnvPos.X, EnvPos.Y].LEnvir)) { Animals.Add(anim); MyMap.AddAnim(anim, EnvPos); anim.IGoAct += MyMap.GoAnimal; anim.ILookAct += MyMap.LookAnimal; anim.ISearchWay += MyMap.SearchWayAnimal; anim.IlookGlCoord += MyMap.GetGlobalCoord; anim.IGetCell += MyMap.GetCellP; anim.IDeath += Delete; return(true); } else { anim.Dispose(); return(false); } } } return(false); }
public override string ToString() { return(ActorID.ToString() + " " + Name); }
public InterCell(ActorID MID, Sprite Spr) { ID = MID; UICSprite = Spr; }