本文整理汇总了C#中EntityProperties类的典型用法代码示例。如果您正苦于以下问题:C# EntityProperties类的具体用法?C# EntityProperties怎么用?C# EntityProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityProperties类属于命名空间,在下文中一共展示了EntityProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Select
void Select(EntityProperties properties)
{
float radius=tilePrefab.transform.lossyScale.x * properties.currentActionsPoints/GameRules.Instance.gameCost.MoveCost;
selected.Clear();
hide = false;
origin.gameObject.SetActive(!hide);
//Cache them so we can easily turn
debugSphere.transform.localScale = new Vector3(radius,radius,radius);
debugSphere.transform.position = properties.owner.position;
Collider[] colliders=Physics.OverlapSphere(properties.owner.position, radius,mask.value);
for (int i = 0; i < colliders.Length; ++i)
{
selected.Add(colliders[i].gameObject);
colliders[i].gameObject.renderer.material = moveMaterial;
}
}
示例2: EntityProperties_SerializedClass_CanConvertToEntityProperties
public void EntityProperties_SerializedClass_CanConvertToEntityProperties()
{
// Arrange
var expectedId = "SomeId";
var ob = new BasicEntity
{
Id = expectedId
};
var data = _serializer.PackSingleObject(ob);
// Act
var entityProperties = new EntityProperties(data);
var containsId = entityProperties.ContainsKey("Id");
string returnedId;
var isString = entityProperties["Id"].TryGet(out returnedId);
// Assert
Assert.True(containsId);
Assert.True(isString);
Assert.Equal(expectedId, returnedId);
}
示例3: OnSelection
void OnSelection(EntityProperties props)
{
if (GameRules.Instance.gameCost.AimedShotCost > props.currentActionsPoints)
{
aimedButton.enabled = false;
aimedButton.SetState(UIButtonColor.State.Disabled, true);
}
else
{
aimedButton.enabled = true;
aimedButton.SetState(UIButtonColor.State.Normal, true);
}
if (GameRules.Instance.gameCost.SnapShotCost > props.currentActionsPoints)
{
snapButton.enabled = false;
snapButton.SetState(UIButtonColor.State.Disabled, true);
}
else
{
snapButton.enabled = true;
snapButton.SetState(UIButtonColor.State.Normal, true);
}
}
示例4: GetPropertyValue
/// <summary>
/// Get the value of the specified property
/// </summary>
/// <param name="properties">property to search for</param>
/// <returns>value of the specified property</returns>
private string GetPropertyValue(string propertyName, EntityProperties properties)
{
// validate that an property name has been set
if (!properties.ContainsKey(propertyName))
{
throw new ArgumentNullException(propertyName, Globals.InputPropertyNotFound);
}
var objectName = properties[propertyName].ToString();
return objectName;
}
示例5: GetPrimaryKeyProperties
private EntityProperties GetPrimaryKeyProperties(DataEntity dataEntity, OleDbMetadataAccess metadataAccess)
{
var primaryKeyProperties = new EntityProperties();
//Use the data entity name to retrieve a list of indexes
var indexColumns = metadataAccess.GetTableIndexInformation(dataEntity.ObjectDefinitionFullName);
//Add each of the Primary Keys and their values found in the data entity.
foreach (DataRow row in indexColumns.Rows)
{
if (!Convert.ToBoolean(row["PRIMARY_KEY"]))
{
continue;
}
var columnName = row["COLUMN_NAME"].ToString();
// Check if the priamry key column is included in the data entity.
if (dataEntity.Properties.ContainsKey(columnName))
{
// Add the key and its value to the primary key list.
primaryKeyProperties.Add(columnName, dataEntity.Properties[columnName]);
}
else
{
// If the key has not been added set it to null.
primaryKeyProperties.Add(columnName, null);
}
}
return primaryKeyProperties;
}
示例6: SimMotionState
public SimMotionState(BSAPIXNA pWorld, uint id, IndexedMatrix starTransform, object frameUpdates)
{
IndexedQuaternion OrientationQuaterion = starTransform.GetRotation();
m_properties = new EntityProperties()
{
ID = id,
Position = new Vector3(starTransform._origin.X, starTransform._origin.Y,starTransform._origin.Z),
Rotation = new Quaternion(OrientationQuaterion.X,OrientationQuaterion.Y,OrientationQuaterion.Z,OrientationQuaterion.W)
};
m_lastProperties = new EntityProperties()
{
ID = id,
Position = new Vector3(starTransform._origin.X, starTransform._origin.Y, starTransform._origin.Z),
Rotation = new Quaternion(OrientationQuaterion.X, OrientationQuaterion.Y, OrientationQuaterion.Z, OrientationQuaterion.W)
};
m_world = pWorld;
m_xform = starTransform;
}
示例7: UpsertingExistingRowInvalidTest
public void UpsertingExistingRowInvalidTest()
{
//create a new method input and use the appropriate operation name
OperationInput operationInput = new OperationInput { Name = "upsert" };
var input = new List<DataEntity>();
var table = new DataEntity();
var columnData = new EntityProperties();
//create a DataEntity for the row
table.ObjectDefinitionFullName = "Customers";
columnData.Add("CustomerNumber", "ABERDEEN0001");
columnData.Add("CompanyName", "Aberdeen Inc.");
columnData.Add("Active", "1");
columnData.Add("Email", "[email protected]");
//add the row data to the input
table.Properties = columnData;
input.Add(table);
operationInput.Input = input.ToArray();
//execute the selected operation
OperationResult operationResult = _sysConnector.ExecuteOperation(operationInput);
//verify the result is a success
Assert.IsTrue(operationResult.Success[0]);
//verify that a row was added
Assert.AreEqual(1, operationResult.ObjectsAffected[0]);
}
示例8: InsertUnknownTableInValidTest
public void InsertUnknownTableInValidTest()
{
//create a new method input and use the appropriate operation name
OperationInput operationInput = new OperationInput { Name = "create" };
var input = new List<DataEntity>();
var table = new DataEntity();
var columnData = new EntityProperties();
//create a DataEntity for the row
table.ObjectDefinitionFullName = InvalidPropertyValue;
columnData.Add("RecordId", Guid.NewGuid().ToString());
columnData.Add("ProductNumber", "134234g");
columnData.Add("ProductName", "Screwdriver");
columnData.Add("Type", "FinishGood");
columnData.Add("UoMSchedule", "65");
columnData.Add("ListPrice", "65");
columnData.Add("Cost", "65");
columnData.Add("StandardCost", "65");
columnData.Add("QuantityInStock", "65");
columnData.Add("QuantityOnOrder", "65");
columnData.Add("Discontinued", "0");
columnData.Add("CreatedOn", DateTime.Now);
columnData.Add("ModifiedOn", DateTime.Now);
//add the row data to the input
table.Properties = columnData;
input.Add(table);
operationInput.Input = input.ToArray();
//execute the selected operation
OperationResult operationResult = _sysConnector.ExecuteOperation(operationInput);
//verify the result is not a success
Assert.IsFalse(operationResult.Success[0]);
Assert.AreEqual(0, operationResult.ObjectsAffected[0]);
}
示例9: PhysicsStepint
private int PhysicsStepint(BulletWorld pWorld,float timeStep, int m_maxSubSteps, float m_fixedTimeStep, out int updatedEntityCount,
out EntityProperties[] updatedEntities, out int collidersCount, out CollisionDesc[] colliders, int maxCollisions, int maxUpdates)
{
int numSimSteps = 0;
Array.Clear(UpdatedObjects, 0, UpdatedObjects.Length);
Array.Clear(UpdatedCollisions, 0, UpdatedCollisions.Length);
LastEntityProperty=0;
LastCollisionDesc=0;
updatedEntityCount = 0;
collidersCount = 0;
if (pWorld is BulletWorldXNA)
{
DiscreteDynamicsWorld world = (pWorld as BulletWorldXNA).world;
world.LastCollisionDesc = 0;
world.LastEntityProperty = 0;
numSimSteps = world.StepSimulation(timeStep, m_maxSubSteps, m_fixedTimeStep);
PersistentManifold contactManifold;
CollisionObject objA;
CollisionObject objB;
ManifoldPoint manifoldPoint;
PairCachingGhostObject pairCachingGhostObject;
m_collisionsThisFrame = 0;
int numManifolds = world.GetDispatcher().GetNumManifolds();
for (int j = 0; j < numManifolds; j++)
{
contactManifold = world.GetDispatcher().GetManifoldByIndexInternal(j);
int numContacts = contactManifold.GetNumContacts();
if (numContacts == 0)
continue;
objA = contactManifold.GetBody0() as CollisionObject;
objB = contactManifold.GetBody1() as CollisionObject;
manifoldPoint = contactManifold.GetContactPoint(0);
//IndexedVector3 contactPoint = manifoldPoint.GetPositionWorldOnB();
// IndexedVector3 contactNormal = -manifoldPoint.m_normalWorldOnB; // make relative to A
RecordCollision(this, objA, objB, manifoldPoint.GetPositionWorldOnB(), -manifoldPoint.m_normalWorldOnB, manifoldPoint.GetDistance());
m_collisionsThisFrame ++;
if (m_collisionsThisFrame >= 9999999)
break;
}
foreach (GhostObject ghostObject in specialCollisionObjects.Values)
{
pairCachingGhostObject = ghostObject as PairCachingGhostObject;
if (pairCachingGhostObject != null)
{
RecordGhostCollisions(pairCachingGhostObject);
}
}
updatedEntityCount = LastEntityProperty;
updatedEntities = UpdatedObjects;
collidersCount = LastCollisionDesc;
colliders = UpdatedCollisions;
}
else
{
//if (updatedEntities is null)
//updatedEntities = new List<BulletXNA.EntityProperties>();
//updatedEntityCount = 0;
//collidersCount = 0;
updatedEntities = new EntityProperties[0];
colliders = new CollisionDesc[0];
}
return numSimSteps;
}
示例10: GetLastModifiedColumnNameFromInput
/// <summary>
/// Retrieve the column name used for checking the last date of synchronization on the column
/// </summary>
/// <param name="properties">The parameters of the MethodInput.</param>
/// <returns>string value of the column name</returns>
private string GetLastModifiedColumnNameFromInput(EntityProperties properties)
{
string columnName = string.Empty;
//check if the column name is specified by checking for the 'ModificationDateFullName' property
if (properties.ContainsKey("ModificationDateFullName"))
{
//set teh column name to the property in the property list
columnName = properties["ModificationDateFullName"].ToString();
}
return columnName;
}
示例11: Initialize
public override BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms,
int maxCollisions, ref CollisionDesc[] collisionArray,
int maxUpdates, ref EntityProperties[] updateArray
)
{
/* TODO */
return new BulletWorldXNA(1, null, null);
}
示例12: UpdateMultipleRowsValidTest
public void UpdateMultipleRowsValidTest()
{
//create a new method input and use the appropriate operation name
OperationInput operationInput = new OperationInput { Name = "update", AllowMultipleObject = true };
var input = new List<DataEntity>();
var table = new DataEntity();
var columnData = new EntityProperties();
//create the comparison experssion for selecting the records to update
operationInput.LookupCondition = new Expression[]
{
new ComparisonExpression(
ComparisonOperator.IsNull,new ComparisonValue(ComparisonValueType.Property, "TaxSchedule"), null, null)
};
//add the columns to change
table.ObjectDefinitionFullName = "Addresses";
columnData.Add("TaxSchedule", "ST-PA");
table.Properties = columnData;
input.Add(table);
operationInput.Input = input.ToArray();
//execute the selected operaiton
var operationResult = _sysConnector.ExecuteOperation(operationInput);
//validate that the operation was success
Assert.IsTrue(operationResult.Success[0]);
//validate that multiple rows have been updated
Assert.IsTrue(operationResult.ObjectsAffected[0] >= 1);
}
示例13: ParseColumns
/// <summary>
/// provides the columns in a format to add to the select statement
/// </summary>
/// <param name="properties">columns to add</param>
/// <returns>colums formated fpor a SQL select statement</returns>
private string ParseColumns(EntityProperties properties)
{
var selectColumns = new StringBuilder();
// add columns
if (properties != null && properties.Count > 0)
{
foreach (var property in properties)
{
selectColumns.Append(" [");
selectColumns.Append(property.Key);
selectColumns.Append("],");
}
selectColumns.Remove(selectColumns.Length - 1, 1);
}
else // all columns
{
selectColumns.Append(" *");
}
return selectColumns.ToString();
}
示例14: UpdateInvalidIntTest
public void UpdateInvalidIntTest()
{
//create a new method input and use the appropriate operation name
OperationInput operationInput = new OperationInput { Name = "update", AllowMultipleObject = false };
var input = new List<DataEntity>();
var table = new DataEntity();
var columnData = new EntityProperties();
//create the comparison experssion for selecting the records to update
operationInput.LookupCondition = new Expression[]
{
new ComparisonExpression(ComparisonOperator.Equal,
new ComparisonValue(ComparisonValueType.Property, "Region"),
new ComparisonValue(ComparisonValueType.Constant, "North"),
null)
};
//add the columns to change
table.ObjectDefinitionFullName = "Customers";
columnData.Add("CreditOnHold", "5328475903427853943453245324532453425345324523453453453425345324523452342345");
columnData.Add("ModifiedOn", DateTime.Now);
table.Properties = columnData;
input.Add(table);
operationInput.Input = input.ToArray();
var operationResult = _sysConnector.ExecuteOperation(operationInput);
//validate that the result of the operation was not a success
Assert.IsFalse(operationResult.Success[0]);
//validate that no objects have been affected
Assert.AreEqual(0, operationResult.ObjectsAffected[0]);
}
示例15: UpdateInvalidDateTest
public void UpdateInvalidDateTest()
{
//create a new method input and use the appropriate operation name
OperationInput operationInput = new OperationInput { Name = "update", AllowMultipleObject = false };
var input = new List<DataEntity>();
var table = new DataEntity();
var columnData = new EntityProperties();
//create the comparison experssion for selecting the records to update
operationInput.LookupCondition = new Expression[]
{
new ComparisonExpression(ComparisonOperator.Equal,
new ComparisonValue(ComparisonValueType.Property, "Type"),
new ComparisonValue(ComparisonValueType.Constant, "Order"),
null)
};
//add the columns to change
table.ObjectDefinitionFullName = "SalesOrders";
columnData.Add("OrderDate", InvalidPropertyValue);
columnData.Add("ModifiedOn", DateTime.Now);
table.Properties = columnData;
input.Add(table);
operationInput.Input = input.ToArray();
var operationResult = _sysConnector.ExecuteOperation(operationInput);
Assert.IsFalse(operationResult.Success[0]);
Assert.AreEqual(0, operationResult.ObjectsAffected[0]);
}