public TrackingObject(ObjectTypes type, ObjectStates state) { Type = type; State = state; properties = new List <PropertyTrackingObject>(); }
protected virtual void SetState(TPlain plain, ObjectStates state) { var objectState = (int)state; plain.state = (stateEnum)objectState; plain.stateSpecified = true; }
public TableContextTrackingObject( ObjectPath path, ObjectTypes type, ObjectStates state) : base(path, type, state) { children = new List <TChild>(); }
private void SetModifedIfNotAdded() { if (State != ObjectStates.Added) { State = ObjectStates.Modified; } }
public Projekt(int projektid, string name, ObjectStates status) { this.projektid = projektid; this.name = name; this.status = status; this.stunden = 0; }
public ObjectState(ObjectStates name, ObjStateProperties props) : this(name) { TickCount = props.TickCount; Distribution = props.Distribution; Eternal = props.Eternal; Id = props.Id; BaseId = props.BaseId; }
public Rechnungszeile(int reid, string bezeichnung, double betrag, int rechnungid, ObjectStates status) { this.reid = reid; this.rechnungid = rechnungid; this.betrag = betrag; this.bezeichnung = bezeichnung; this.status = status; }
public AttachmentTrackingObject( ObjectPath path, ObjectTypes type, ObjectStates state, Maybe <MessageTrackingObject> embeddedMessageTrackingObject) : base(path, type, state) { EmbeddedMessageTrackingObject = embeddedMessageTrackingObject; }
public void PickupObject() { currentState = ObjectStates.Held; if (GetComponent <AudioSource>()) { GetComponent <AudioSource>().enabled = true; } }
public ObjectState(ObjectStates name, ObjStateProperties props, uint?id, uint?baseId = null) : this(name) { TickCount = props.TickCount; Distribution = props.Distribution; Eternal = props.Eternal; Id = id; BaseId = baseId; }
public Buchung(int buchungid, double betrag, int kategorie, DateTime datum, int rechnungid, ObjectStates status) { this.buchungid = buchungid; this.betrag = betrag; this.kategorie = kategorie; this.datum = datum; this.rechnungid = rechnungid; this.status = status; }
public Ausgang(int rechnungid, string bezeichnung, DateTime datum, int kundenid, int projektid, ObjectStates status) { this.rechnungid = rechnungid; this.bezeichnung = bezeichnung; this.datum = datum; this.kundenid = kundenid; this.projektid = projektid; this.status = status; }
public MessageTrackingObject( ObjectPath path, ObjectTypes type, ObjectStates state, TableContextTrackingObject <TrackingObject> recipientTableTrackingObject, TableContextTrackingObject <AttachmentTrackingObject> attachmentTableTrackingObject) : base(path, type, state) { RecipientTableTrackingObject = recipientTableTrackingObject; AttachmentTableTrackingObject = attachmentTableTrackingObject; }
public Eingang(int rechnungid, string bezeichnung, DateTime datum, double betrag, string path, int kontaktid, ObjectStates status) { this.rechnungid = rechnungid; this.bezeichnung = bezeichnung; this.datum = datum; this.betrag = betrag; this.path = path; this.kontaktid = kontaktid; this.status = status; }
void HitTarget() { if (Target) { ObjectStates TargetObjectState = Target.GetComponent <ObjectStates>(); if (TargetObjectState) { TargetObjectState.Hp = TargetObjectState.Hp - Attack; } } }
protected virtual void idleUpdate(Vector2 collisionCenter, GameObject obj) { do { currentWaypoint = getNextWaypoint(); currentPath = PathFinder.FindReducedPath(TileMap.GetCellByPixel(collisionCenter), currentWaypoint); } while (currentPath == null); pathIndex = 0; currentGoal = currentPath[pathIndex]; changeDirection(collisionCenter, obj); objectState = ObjectStates.WALKING; }
public FolderTrackingObject( ObjectPath path, ObjectTypes type, ObjectStates state, TableContextTrackingObject <FolderTrackingObject> hierarchyTableTrackingObject, TableContextTrackingObject <MessageTrackingObject> contentsTableTrackingObject, TableContextTrackingObject <MessageTrackingObject> faiContentsTableTrackingObject) : base(path, type, state) { HierarchyTableTrackingObject = hierarchyTableTrackingObject; ContentsTableTrackingObject = contentsTableTrackingObject; FAIContentsTableTrackingObject = faiContentsTableTrackingObject; }
public Angebot(int angebotid, string titel, double summe, DateTime datum, int dauer, int chance, int kundenid, int projektid, ObjectStates status) { this.angebotid = angebotid; this.titel = titel; this.summe = summe; this.datum = datum; this.dauer = dauer; this.chance = chance; this.kundenid = kundenid; this.projektid = projektid; this.status = status; }
public void TrackObject(ObjectPath objectPath, ObjectTypes objectType, ObjectStates objectState) { var trackingObject = new NodeTrackingObject(objectPath, objectType, objectState); if (!objectPath.HasParent) { rootTrackingObjects.Add(objectPath, trackingObject); } else { GetTrackingObject(objectPath.ParentObjectPath).AddChild(trackingObject); } }
public Kunde(int kundenid, string vorname, string nachname, string email, ObjectStates status) { this.kundenid = kundenid; this.vorname = vorname; this.nachname = nachname; this.email = email; this.adresse = string.Empty; this.hausnummer = string.Empty; this.plz = string.Empty; this.ort = string.Empty; this.telefon = string.Empty; this.bemerkungen = string.Empty; this.status = status; }
/// <summary> /// The routine that runs when the ObjectState is idle /// </summary> /// <param name="collisionCenter"> The objects collisioncenter </param> /// <param name="obj"> The object to update </param> protected virtual void IDLEUpdate(Vector2 collisionCenter, GameObject obj) { do { CurrentWaypoint = GetNextWaypoint(); var coordCell = _tileMap.GetCellByPixel(collisionCenter); CurrentPath = PathFinder <Map <string>, string> .FindReducedPath(coordCell, CurrentWaypoint, _tileMap); } while (CurrentPath == null); PathIndex = 0; CurrentGoal = CurrentPath[PathIndex]; ChangeDirection(collisionCenter, obj); ObjectState = ObjectStates.Walking; }
protected virtual void walkingUpdate(Vector2 collisionCenter, GameObject obj) { obj.Position += speed * direction; if (Vector2.Distance(collisionCenter, TileMap.GetCellCenter(currentGoal)) <= speed * 2 && pathIndex != currentPath.Count - 1) { currentGoal = currentPath[++pathIndex]; changeDirection(collisionCenter, obj); } if (Vector2.Distance(collisionCenter, TileMap.GetCellCenter(currentWaypoint)) <= speed * 2) { objectState = ObjectStates.IDLE; } }
public Kontakt(int kontaktid, string vorname, string nachname, string firmenname, string email, ObjectStates status) { this.kontaktid = kontaktid; this.vorname = vorname; this.nachname = nachname; this.firmenname = firmenname; this.email = email; this.adresse = string.Empty; this.hausnummer = string.Empty; this.plz = string.Empty; this.ort = string.Empty; this.telefon = string.Empty; this.bemerkungen = string.Empty; this.status = status; }
/// <summary> /// The routine that runs when the ObjectState is walking /// </summary> /// <param name="collisionCenter"> The objects collisioncenter </param> /// <param name="obj"> The object to update </param> protected virtual void WalkingUpdate(Vector2 collisionCenter, GameObject obj) { obj.Position += Speed * Direction; if (Vector2.Distance(collisionCenter, _tileMap.GetCellCenter(CurrentGoal)) <= Speed * 2 && PathIndex != CurrentPath.Count - 1) { CurrentGoal = CurrentPath[++PathIndex]; ChangeDirection(collisionCenter, obj); } if (Vector2.Distance(collisionCenter, _tileMap.GetCellCenter(CurrentWaypoint)) <= Speed * 2) { ObjectState = ObjectStates.IDLE; } }
public static EntityState ConvertState(ObjectStates state) { switch (state) { case ObjectStates.Added: return(EntityState.Added); case ObjectStates.Modified: return(EntityState.Modified); case ObjectStates.Deleted: return(EntityState.Deleted); default: return(EntityState.Unchanged); } }
private void SetObjects(GameCore game) { //If an object is added, we need to recover by restarting the method //(collection will have been modified) try { foreach (var obj in game.GameObjects) { ObjectStates.Add(new FullObjectState(obj.FullState)); } } catch (InvalidOperationException) { ObjectStates.Clear(); SetObjects(game); } }
private static void CMConfig() { ObjectStates.SetAll(i => ObjectStates[i] = ObjectStateTypes[i].CreateInstanceSafe <LegendState>()); Array.Sort( ObjectStates, (l, r) => { int result = 0; if (l.CompareNull(r, ref result)) { return(result); } return(l.SupportedType.CompareTo(r.SupportedType)); }); }
void StartDissolve() { if (lifeLine) { currentState = ObjectStates.Decaying; if (dissolveScript) { dissolveScript.Dissolve(); ObjectManager.m_Objects.Remove(gameObject); Destroy(gameObject, dissolveScript.dissolveDuration); } else { ObjectManager.m_Objects.Remove(gameObject); Destroy(gameObject, 1); } Destroy(this); } }
public WITemplate(WorldItem worlditem) { Name = worlditem.Props.Name.PrefabName; StackItem si = worlditem.GetTemplate(); Props.CopyLocalNames(si.Props); Props.CopyGlobalNames(si.Props); Props.CopyLocal(si.Props); Props.Global = worlditem.Props.Global; SaveState = si.SaveState; Props.Local.Mode = WIMode.Unloaded; Props.Local.PreviousMode = WIMode.Unloaded; WIStates states = null; if (worlditem.gameObject.HasComponent <WIStates>(out states)) { ObjectStates.AddRange(states.States); } }
private static void Enqueue <T>(T obj) { if (!_Updating) { OnAbort(); return; } IDictionary <string, SimpleType> data = null; LegendState state = ObjectStates.FirstOrDefault(s => s.Compile(obj, out data)); if (state != null && data != null && data.Count > 0) { ExportQueue.GetOrAdd(state.TableName, new ConcurrentStack <QueuedData>()).Push( new QueuedData { RawData = data, SqlData = data.Select(kd => new MySQLData(kd.Key, SQL.Encode(kd.Value, true))).ToArray() }); } }
public PseudoFullGameWorldState MakeDelta(PseudoFullGameWorldState lastState) { var state = new PseudoFullGameWorldState(); foreach (var obj in lastState.ObjectStates.Values) { //It was destroyed, flag it if (!ObjectStates.ContainsKey(obj.ObjectId)) { state._objectStates.Add(obj.ObjectId, new PseudoFullObjectState(obj, true)); } //Otherwise, compute state differences else { var objState = new PseudoFullObjectState(obj, ObjectStates[obj.ObjectId]); if (objState.HasChanges(obj)) { state._objectStates.Add(obj.ObjectId, objState); } } } //Then do a reverse search to find the new ones foreach (var obj in ObjectStates.Values) { if (!lastState.ObjectStates.ContainsKey(obj.ObjectId) && !state.ObjectStates.ContainsKey(obj.ObjectId)) { state._objectStates.Add(obj.ObjectId, obj); } } state.CurrentGameStatus = CurrentGameStatus; state.CurrentGameTimeMilliseconds = CurrentGameTimeMilliseconds; state.FriendlyFireEnabled = FriendlyFireEnabled; return(state); }
public static bool IsTransitionAllowed(int incident_id, ObjectStates oldStateId, ObjectStates StateId) { if(oldStateId == StateId) return true; bool retval = false; //Mediachase.IBN.Business.Project.ProjectSecurity Project.ProjectSecurity p_security = null; string RoleFilter = ""; //global roles security if(Security.IsUserInGroup(InternalSecureGroups.Administrator)) RoleFilter += "Role/@name='ADMIN' or "; if(Security.IsUserInGroup(InternalSecureGroups.ProjectManager)) RoleFilter += "Role/@name='PM' or "; if(Security.IsUserInGroup(InternalSecureGroups.PowerProjectManager)) RoleFilter += "Role/@name='PPM' or "; if(Security.IsUserInGroup(InternalSecureGroups.HelpDeskManager)) RoleFilter += "Role/@name='HDM' or "; if(Security.IsUserInGroup(InternalSecureGroups.ExecutiveManager)) RoleFilter += "Role/@name='EXEC' or "; //Incident's role security IncidentSecurity2 i_security = GetSecurity2(incident_id); if(i_security.IsController) RoleFilter += "Role/@name='Controller' or "; if(i_security.IsCreator) RoleFilter += "Role/@name='Creator' or "; if(i_security.IsManager) RoleFilter += "Role/@name='Manager' or "; if(i_security.IsPendingResource) RoleFilter += "Role/@name='wResource' or "; if(i_security.IsResource) RoleFilter += "Role/@name='Resource' or "; if(i_security.IsPendingResponsible) RoleFilter += "Role/@name='wResponsible' or "; if(i_security.IsResponsible) RoleFilter += "Role/@name='Responsible' or "; //Incident's role security int ProjectId = DBIncident.GetProject(incident_id); if (ProjectId > 0) { p_security = Project.GetSecurity(ProjectId); if(p_security.IsTeamMember) RoleFilter += "Role/@name='p_TeamMemeber' or "; if(p_security.IsSponsor) RoleFilter += "Role/@name='p_Sponsor' or "; if(p_security.IsStakeHolder) RoleFilter += "Role/@name='p_StakeHolder' or "; if(p_security.IsManager) RoleFilter += "Role/@name='p_Manager' or "; } //ToDO's role security //TODO: implement RoleFilter += "1=0"; string newState = ""; switch(StateId) { case ObjectStates.Upcoming: newState += "new"; break; case ObjectStates.Active: newState += "open"; break; case ObjectStates.Completed: newState += "closed"; break; case ObjectStates.OnCheck: newState += "oncheck"; break; case ObjectStates.ReOpen: newState += "reopen"; break; case ObjectStates.Suspended: newState += "suspended"; break; } string oldState = ""; switch(oldStateId) { case ObjectStates.Upcoming: oldState += "new"; break; case ObjectStates.Active: oldState += "open"; break; case ObjectStates.Completed: oldState += "closed"; break; case ObjectStates.OnCheck: oldState += "oncheck"; break; case ObjectStates.ReOpen: oldState += "reopen"; break; case ObjectStates.Suspended: oldState += "suspended"; break; } //load xml System.IO.Stream st = System.Reflection.Assembly.GetAssembly(typeof(Incident)).GetManifestResourceStream("Mediachase.IBN.Business.Resources.IncidentStateMachine.xml"); XmlDocument doc = new XmlDocument(); doc.Load(st); IncidentBoxDocument incdoc = IncidentBoxDocument.Load(GetIncidentBox(incident_id)); string query = ""; query +=@"/StateMachines/StateMachine[@name='"; if(incdoc.GeneralBlock.AllowControl) query +="with_check"; else query +="without_check"; query +=@"']/States/State[@name='"; query +=oldState; query +=@"']/Action[@name='"; query +="ChangeState"; query +=@"']/Transition["; query += RoleFilter; query += "][@to ='"; query += newState; query += "']"; XmlNodeList nodeList = doc.SelectNodes(query); retval = nodeList.Count > 0; return retval; }
public void TrackRecipient(ObjectPath messageObjectPath, NID recipientTableNodeId, int recipientRowId, ObjectStates recipientState) { trackedRecipientTables[messageObjectPath].TrackedRecipients.Add( recipientRowId, new TrackingObject(ObjectTypes.Recipient, recipientState)); }
public void TrackRecipientTable(ObjectPath messageObjectPath, NID recipientTableNodeId, ObjectStates tableState) { trackedRecipientTables.Add( messageObjectPath, new RecipientTableTrackingObject(recipientTableNodeId, ObjectTypes.RecipientTable, tableState)); }
public static void SetIncidentState(ForumStorage.NodeType nodeType, IncidentBoxDocument incidentBoxDocument, int IncidentId, int ThreadNodeId, ObjectStates state) { Issue2.SetStateByEmail(nodeType, incidentBoxDocument, IncidentId, ThreadNodeId, state); }
public NinjaEquipment ChangeOwner(int newNinjaId) { NinjaId = newNinjaId; State = ObjectStates.Modified; return(this); }
public static void SetStateByEmail(ForumStorage.NodeType nodeType, IncidentBoxDocument incidentBoxDocument, int IncidentId, int ThreadNodeId, ObjectStates state) { //if(ForumStorage.NodeType.Outgoing == nodeType || ForumStorage.NodeType.Internal == nodeType) { int stateId = (int)state; int oldStateId = -1; int responsibleId = -1; bool oldIsGroupResponsobility = false; using(IDataReader reader = Incident.GetIncidentTrackingState(IncidentId, false)) { if(reader.Read()) { oldStateId = (int)reader["StateId"]; responsibleId = (int)reader["ResponsibleId"]; oldIsGroupResponsobility = (bool)reader["IsResponsibleGroup"]; } } if(stateId==(int)ObjectStates.ReOpen && oldStateId==(int)ObjectStates.Active) return; using(DbTransaction tran = DbTransaction.Begin()) { if(stateId != oldStateId) UpdateStateAndNotifyController(IncidentId, stateId, ThreadNodeId); if(stateId == (int)ObjectStates.Active || stateId == (int)ObjectStates.ReOpen || stateId == (int)ObjectStates.Upcoming) { //set responsible if it's incoming and resp not set if(responsibleId <= 0) { DbIssue2.UpdateResponsibility(IncidentId, Security.UserID, false); // O.R.[2008-12-16]: Recalculate Current Responsible DBIncident.RecalculateCurrentResponsible(IncidentId); SystemEvents.AddSystemEvents(SystemEventTypes.Issue_Updated_Responsible_Assigned, IncidentId, Security.UserID); IncidentForum.AddForumMesageWithResponsibleChange(IncidentId, ThreadNodeId, Security.UserID); } } tran.Commit(); } } }
public NodeTrackingObject(ObjectPath path, ObjectTypes type, ObjectStates state) : base(type, state) { Path = path; children = new List <NodeTrackingObject>(); }
public ObjectState(ObjectStates name) { Name = name; }
/// <summary> /// Processes the X ibn headers. /// </summary> /// <param name="IncidentId">The incident id.</param> /// <param name="ThreadNodeId">The thread node id.</param> /// <param name="Msg">The MSG.</param> /// <returns></returns> public static bool ProcessXIbnHeaders(int IncidentId, int ThreadNodeId, Pop3Message Msg) { bool bRetVal = true; ForumStorage.NodeType nodeType = ForumStorage.NodeType.Internal; ForumThreadNodeSettingCollection settings = new ForumThreadNodeSettingCollection(ThreadNodeId); if (settings.Contains(ForumThreadNodeSetting.Incoming)) { nodeType = ForumStorage.NodeType.Incoming; } else if (settings.Contains(ForumThreadNodeSetting.Outgoing)) { nodeType = ForumStorage.NodeType.Outgoing; } bool bSetIncidentState = false; ObjectStates cmdObjectStates = ObjectStates.Active; int newResponsibleId = 0; foreach (string HeaderName in Msg.Headers.AllKeys) { string UpHeaderName = HeaderName.ToUpper(); if (UpHeaderName.StartsWith("X-IBN-")) { switch (UpHeaderName) { case "X-IBN-STATE": if (Msg.Headers[HeaderName].Trim() != "0") { cmdObjectStates = (ObjectStates)Enum.Parse(typeof(ObjectStates), Msg.Headers[HeaderName]); if (cmdObjectStates >= ObjectStates.Upcoming && cmdObjectStates <= ObjectStates.OnCheck) { bSetIncidentState = true; } else { // OZ: Wrong Object State cmdObjectStates = ObjectStates.Active; } } break; case "X-IBN-PRIVATEMSG": if (Msg.Headers[HeaderName].Trim() != "0") { XIbnHeaderCommand.SetPrivateStatus(ThreadNodeId); nodeType = ForumStorage.NodeType.Internal; bRetVal = false; } break; case "X-IBN-RESOLUTION": if (Msg.Headers[HeaderName].Trim() != "0") { XIbnHeaderCommand.SetResolutionStatus(ThreadNodeId); } break; case "X-IBN-WORKAROUND": if (Msg.Headers[HeaderName].Trim() != "0") { XIbnHeaderCommand.SetWorkaroundStatus(ThreadNodeId); } break; case "X-IBN-RESPONSIBLE": if (Msg.Headers[HeaderName].Trim() != "0") { newResponsibleId = int.Parse(Msg.Headers[HeaderName]); } break; default: XIbnHeaderCommand.Unknown(IncidentId, Msg.Headers[HeaderName]); break; } } } // Set Default IBN Object State if (!bSetIncidentState) { if (nodeType == ForumStorage.NodeType.Incoming) { IncidentBoxDocument document = IncidentBoxDocument.Load(Incident.GetIncidentBox(IncidentId)); switch (document.EMailRouterBlock.IncomingEMailAction) { case ExternalEMailActionType.None: break; case ExternalEMailActionType.SetReOpenState: XIbnHeaderCommand.SetIncidentState(nodeType, document, IncidentId, ThreadNodeId, ObjectStates.ReOpen); break; } } else if (nodeType == ForumStorage.NodeType.Outgoing) { IncidentBoxDocument document = IncidentBoxDocument.Load(Incident.GetIncidentBox(IncidentId)); switch (document.EMailRouterBlock.OutgoingEMailAction) { case InternalEMailActionType.None: break; case InternalEMailActionType.SendToCheck: XIbnHeaderCommand.SetIncidentState(nodeType, document, IncidentId, ThreadNodeId, ObjectStates.OnCheck); break; case InternalEMailActionType.SetCompletedState: XIbnHeaderCommand.SetIncidentState(nodeType, document, IncidentId, ThreadNodeId, ObjectStates.Completed); break; case InternalEMailActionType.SetSuspendState: XIbnHeaderCommand.SetIncidentState(nodeType, document, IncidentId, ThreadNodeId, ObjectStates.Suspended); break; } } } else { IncidentBoxDocument document = IncidentBoxDocument.Load(Incident.GetIncidentBox(IncidentId)); XIbnHeaderCommand.SetIncidentState(nodeType, document, IncidentId, ThreadNodeId, cmdObjectStates); } // OZ: 2008-11-24 ChangeResponsible, -1 = NotSet, -2 = Group if (newResponsibleId != 0) { XIbnHeaderCommand.ChangeResponsible(IncidentId, newResponsibleId); } return(bRetVal); }