本文整理汇总了C#中IObject类的典型用法代码示例。如果您正苦于以下问题:C# IObject类的具体用法?C# IObject怎么用?C# IObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IObject类属于命名空间,在下文中一共展示了IObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IsProperty
public bool IsProperty(IObject element)
{
var attributeXmi = "{" + Namespaces.Xmi + "}type";
return element.isSet(attributeXmi) &&
element.get(attributeXmi).ToString() == "uml:Property";
}
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:7,代码来源:XmiSourceParser.cs
示例2: WalkClass
protected override void WalkClass(IObject classInstance, CallStack stack)
{
var name = GetNameOfElement(classInstance);
Result.AppendLine($"{stack.Indentation}if(name == \"{name}\") // Looking for class");
Result.AppendLine($"{stack.Indentation}{{");
string fullName;
if (stack.Level == 1)
{
// Removes the name of the package of the first hierarchy level
// since it is already included into the class name
fullName = $".__{name}";
}
else
{
fullName = $"{stack.Fullname}.__{name}";
}
var ifStack = stack.NextWithoutLevelIncrease;
var ifForeachStack = ifStack.NextWithoutLevelIncrease;
Result.AppendLine($"{ifStack.Indentation}tree{fullName} = value;");
Result.AppendLine($"{ifStack.Indentation}isSet = value.isSet(\"ownedAttribute\");");
Result.AppendLine(
$"{ifStack.Indentation}collection = isSet ? (value.get(\"ownedAttribute\") as IEnumerable<object>) : EmptyList;");
Result.AppendLine($"{ifStack.Indentation}foreach (var item{ifStack.Level} in collection)");
Result.AppendLine($"{ifStack.Indentation}{{");
Result.AppendLine($"{ifForeachStack.Indentation}value = item{ifStack.Level} as IElement;");
Result.AppendLine($"{ifForeachStack.Indentation}name = GetNameOfElement(value);");
base.WalkClass(classInstance, ifStack);
Result.AppendLine($"{ifStack.Indentation}}}");
Result.AppendLine($"{stack.Indentation}}}");
}
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:34,代码来源:FillClassTreeByExtentCreator.cs
示例3: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
///cast to out world instance
PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld;
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
///Physic Triangle mesh (same as bepu)
PhysxTriangleMesh tmesh = new PhysxTriangleMesh(PhysxPhysicWorld,simpleModel,
Matrix.Identity, Vector3.One);
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
///Ball Throw !!!
BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory);
this.AttachCleanUpAble(BallThrowBullet);
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:26,代码来源:Physx28Screen.cs
示例4: onSaveGameLoaded
private void onSaveGameLoaded()
{
_panel = _game.Find<IPanel>(_panel.ID);
_inventoryItemIcon = _game.Find<IObject>(_inventoryItemIcon.ID);
_player = _game.State.Player;
_lastInventoryItem = null;
}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:TopBar.cs
示例5: LoadContent
/// <summary>
/// Load content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
float x, y;
x = -i * 100;
y = -j * 100;
TreeModel tm = new TreeModel(factory, "Trees\\Pine", null, null);
ForwardTreeShader ts = new ForwardTreeShader();
TreeMaterial tmat = new TreeMaterial(ts, new WindStrengthSin());
GhostObject go = new GhostObject(new Vector3(x, 0, y), Matrix.Identity, new Vector3(0.05f));
IObject ox = new IObject(tmat, tm, go);
this.World.AddObject(ox);
}
}
}
///add a camera
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo.Viewport));
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:33,代码来源:TemplateForwardScreen.cs
示例6: IsSuperClass
/// <summary>
/// Tests if an object is a plugin with the supplied SuperClass.
/// </summary>
public static bool IsSuperClass(IObject objectRef, SClass_ID scid)
{
if (objectRef == null)
return false;
return objectRef.SuperClassID == scid;
}
开发者ID:Sugz,项目名称:Outliner-3.0,代码行数:10,代码来源:ClassIDs.cs
示例7: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
var newCameraFirstPerson = new CameraStatic(new Vector3(100,100,100), - new Vector3(100,100,100) );
this.World.CameraManager.AddCamera(newCameraFirstPerson);
SimpleConcreteGestureInputPlayable SimpleConcreteGestureInputPlayable = new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.DoubleTap, (sample) => doubleTapCount++);
this.BindInput(SimpleConcreteGestureInputPlayable);
this.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.Hold,
(sample) =>
{
this.RemoveInputBinding(SimpleConcreteGestureInputPlayable);
doubleTapDisabled = true;
}
));
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:27,代码来源:InputGestureScreen.cs
示例8: Billboard3D
public Billboard3D(Texture2D tex,IObject obj, Vector3 displacement, Vector2 scale)
{
this.Texture = tex;
this.Position = displacement;
this.obj = obj;
this.Scale = scale;
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:Bilboard3D.cs
示例9: AssociationEquals
internal AssociationEquals(ExtentFiltered extent, IAssociationType association, IObject allorsObject)
{
extent.CheckAssociation(association);
PredicateAssertions.AssertAssociationEquals(association, allorsObject);
this.association = association;
this.allorsObject = allorsObject;
}
开发者ID:whesius,项目名称:allors,代码行数:7,代码来源:AssociationEquals.cs
示例10: SpawnPrimitive
/// <summary>
/// Create a simple Sphere object
/// </summary>
/// <param name="pos"></param>
/// <param name="ori"></param>
/// <returns></returns>
private IObject SpawnPrimitive(Vector3 pos, Matrix ori)
{
///Load a Model with a custom texture
sm2 = new SimpleModel(factory,"Model\\ball");
sm2.SetTexture(factory.CreateTexture2DColor(1,1,Color.White,false), TextureType.DIFFUSE);
IMaterial m;
if (forward)
{
ForwardXNABasicShader nd = new ForwardXNABasicShader();
m = new ForwardMaterial(nd);
}
else
{
DeferredNormalShader nd = new DeferredNormalShader();
m = new DeferredMaterial(nd);
}
PhysxPhysicWorld PhysxPhysicWorld = _mundo.PhysicWorld as PhysxPhysicWorld;
SphereShapeDescription SphereGeometry = new SphereShapeDescription(5f);
PhysxPhysicObject PhysxPhysicObject = new PhysxPhysicObject(SphereGeometry,
0.5f, Matrix.CreateTranslation(pos), Vector3.One * 5f);
IObject o = new IObject(m, sm2, PhysxPhysicObject);
return o;
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:32,代码来源:BallThrowPhysx28.cs
示例11: RoleContains
internal RoleContains(ExtentFiltered extent, IRoleType role, IObject allorsObject)
{
extent.CheckRole(role);
PredicateAssertions.ValidateRoleContains(role, allorsObject);
this.role = role;
this.allorsObject = allorsObject;
}
开发者ID:whesius,项目名称:allors,代码行数:7,代码来源:RoleContains.cs
示例12: GetName
public string GetName(IObject element)
{
// Returns the name by the uml logic.
var dataLayer = _dataLayerLogic?.GetDataLayerOfObject(element);
var metaLayer = _dataLayerLogic?.GetMetaLayerFor(dataLayer);
var uml = _dataLayerLogic?.Get<_UML>(metaLayer);
if (uml != null && element.isSet(_UML._CommonStructure._NamedElement.name))
{
var result = element.get(_UML._CommonStructure._NamedElement.name);
if (result != null)
{
return result.ToString();
}
}
// If the element is not uml induced or the property is empty, check by
// the default "name" property
if (element.isSet("name"))
{
return element.get("name").ToString();
}
// Ok, finally, we don't know what to do, so request retrieve the name just via ToString
return element.ToString();
}
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:25,代码来源:UmlNameResolution.cs
示例13: MakeActive
public void MakeActive(IObject Object)
{
activeObject = Object;
if(! (activeObject is ControlPoint)) {
if(activeObject != null)
application.EditProperties(activeObject, activeObject.GetType().Name);
controlPoints.Clear();
}
if(activeObject != null && activeObject.Resizable) {
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.TOP | ControlPoint.AttachPoint.LEFT));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.TOP));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.TOP | ControlPoint.AttachPoint.RIGHT));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.LEFT));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.RIGHT));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.BOTTOM | ControlPoint.AttachPoint.LEFT));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.BOTTOM));
controlPoints.Add(new ControlPoint(activeObject,
ControlPoint.AttachPoint.BOTTOM | ControlPoint.AttachPoint.RIGHT));
}
application.PrintStatus( "ObjectsEditor:MakeActive(" + activeObject + ")" );
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:30,代码来源:ObjectsEditor.cs
示例14: AGSInteractions
public AGSInteractions (IInteractions defaultInteractions, IObject obj, IGameState state)
{
_events = new ConcurrentDictionary<string, IEvent<ObjectEventArgs>>();
_inventoryEvents = new ConcurrentDictionary<string, IEvent<InventoryInteractEventArgs>>();
var defaultInteractionEvent = new AGSInteractionEvent<ObjectEventArgs>(
new List<IEvent<ObjectEventArgs>>(), DEFAULT, obj, state);
var defaultInventoryEvent = new AGSInteractionEvent<InventoryInteractEventArgs>(
new List<IEvent<InventoryInteractEventArgs>>(), DEFAULT, obj, state);
_events.TryAdd(DEFAULT, defaultInteractionEvent);
_inventoryEvents.TryAdd(DEFAULT, defaultInventoryEvent);
_factory = verb =>
{
List<IEvent<ObjectEventArgs>> interactions = new List<IEvent<ObjectEventArgs>> { defaultInteractionEvent };
if (defaultInteractions != null)
{
interactions.Add(defaultInteractions.OnInteract(verb));
if (verb != DEFAULT) interactions.Add(defaultInteractions.OnInteract(DEFAULT));
}
return new AGSInteractionEvent<ObjectEventArgs>(interactions, verb, obj, state);
};
_inventoryFactory = verb =>
{
List<IEvent<InventoryInteractEventArgs>> interactions = new List<IEvent<InventoryInteractEventArgs>> { defaultInventoryEvent };
if (defaultInteractions != null)
{
interactions.Add(defaultInteractions.OnInventoryInteract(verb));
if (verb != DEFAULT) interactions.Add(defaultInteractions.OnInventoryInteract(DEFAULT));
}
return new AGSInteractionEvent<InventoryInteractEventArgs>(interactions, verb, obj, state);
};
}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:32,代码来源:AGSInteractions.cs
示例15: Draw
protected override void Draw(GameTime gt, IObject obj, RenderHelper render, ICamera cam, IList<ILight> lights)
{
Vector3 dir = cam.Target - cam.Position;
dir.Normalize();
_shader.Parameters["forward"].SetValue(dir);
_shader.Parameters["camUp"].SetValue(cam.Up);
_shader.Parameters["scaleX"].SetValue(scale.X);
_shader.Parameters["scaleY"].SetValue(scale.Y);
_shader.Parameters["xWorld"].SetValue(obj.PhysicObject.WorldMatrix);
_shader.Parameters["xView"].SetValue(cam.View);
_shader.Parameters["xProjection"].SetValue(cam.Projection);
//_shader.Parameters["xBillboardTexture"].SetValue(obj.Modelo.getTexture(TextureType.DIFFUSE,0,0));
render.Textures[0] = obj.Modelo.getTexture(TextureType.DIFFUSE, 0, 0);
_shader.Parameters["atenuation"].SetValue(atenuation);
render.PushRasterizerState(RasterizerState.CullNone);
BatchInformation batchInfo = obj.Modelo.GetBatchInformation(0)[0];
{
_shader.Parameters["alphaTest"].SetValue(alphaTestLimit);
render.RenderBatch(batchInfo, _shader);
}
render.PopRasterizerState();
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:DeferredSphericalBilboardShader.cs
示例16: LoadContent
/// <summary>
/// Load content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
///Uncoment to add your model
SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
///Physic info (position, rotation and scale are set here)
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
///Forward Shader (look at this shader construction for more info)
ForwardXNABasicShader shader = new ForwardXNABasicShader();
///Forward material
ForwardMaterial fmaterial = new ForwardMaterial(shader);
///The object itself
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
///Add to the world
this.World.AddObject(obj);
this.RenderTechnic.AddPostEffect(MotionBlurPostEffect);
this.RenderTechnic.AddPostEffect(BloomPostEffect);
BloomPostEffect.Enabled = false;
MotionBlurPostEffect.Enabled = false;
blurdefault = MotionBlurPostEffect.Amount;
RotatingCamera cam = new RotatingCamera(this, new Vector3(0,-100,-400));
this.World.CameraManager.AddCamera(cam);
RasterizerState = new RasterizerState();
RasterizerState.CullMode = CullMode.None;
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:38,代码来源:PostEffectScreen.cs
示例17: MRMPrim
public MRMPrim(IObject obj, MRMPrimFactory factory)
{
_factory = factory;
_id = obj.GlobalID;
_factory.RegisterPrim(this);
SetUpExistingObj(obj, factory);
}
开发者ID:JohnMcCaffery,项目名称:RoutingIsland,代码行数:7,代码来源:MRMPrim.cs
示例18: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
///Uncoment to add your model
SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
///Physic info (position, rotation and scale are set here)
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
///Forward Shader (look at this shader construction for more info)
ForwardXNABasicShader shader = new ForwardXNABasicShader();
///Deferred material
ForwardMaterial fmaterial = new ForwardMaterial(shader);
///The object itself
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
///Add to the world
this.World.AddObject(obj);
}
{
SnowParticleSystem snow = new SnowParticleSystem();
DPFSParticleSystem ps = new DPFSParticleSystem("snow", snow);
this.World.ParticleManager.AddAndInitializeParticleSystem(ps);
///cant set emiter position before adding the particle
///IF YOU DO SO, IT WILL NOT WORK
snow.Emitter.PositionData.Position = new Vector3(500, 0, 0);
}
CameraFirstPerson cam = new CameraFirstPerson(MathHelper.ToRadians(-50), MathHelper.ToRadians(-10), new Vector3(-150, 150, 150), GraphicInfo);
this.World.CameraManager.AddCamera(cam);
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:32,代码来源:ParticleScreen.cs
示例19: DeathRecord
/// <summary>
/// Constructs a death record around an existing object,
/// adding death record properties (with default values) as necessary.
/// </summary>
/// <param name="target">the object containing / to contain the death record information</param>
protected DeathRecord(IObject target)
: base(target)
{
if (!PropertyExists(PropertyTags.City))
AddProperty(PropertyTags.City, "Unspecified");
if (!PropertyExists(PropertyTags.AgeInYears))
AddProperty(PropertyTags.AgeInYears, "-1");
if (!PropertyExists(PropertyTags.Gender))
AddProperty(PropertyTags.Gender, "U");
if (!PropertyExists(PropertyTags.Race))
AddProperty(PropertyTags.Race, "U");
if (!PropertyExists(PropertyTags.Volume))
AddProperty(PropertyTags.Volume, "-1");
if (!PropertyExists(PropertyTags.Page))
AddProperty(PropertyTags.Page, "-1");
if (!PropertyExists(PropertyTags.CertificateNumber))
AddProperty(PropertyTags.CertificateNumber, "-1");
if (!PropertyExists(PropertyTags.County))
AddProperty(PropertyTags.County, "Unspecified");
if (!PropertyExists(PropertyTags.LastName))
AddProperty(PropertyTags.LastName, "Unknown");
if (!PropertyExists(PropertyTags.FirstName))
AddProperty(PropertyTags.FirstName, "Unknown");
if (!PropertyExists(PropertyTags.MiddleName))
AddProperty(PropertyTags.MiddleName, string.Empty);
}
开发者ID:jcvlcek,项目名称:DenniHlasatelDeathIndexExplorer,代码行数:31,代码来源:DeathRecord.cs
示例20: ValidateWorkingBase
public override bool ValidateWorkingBase(IObject workingBase, DBTypeManager typeManager)
{
if (workingBase is DBTypeAttribute)
{
var workingTypeAttribute = (workingBase as DBTypeAttribute).GetValue();
if (workingTypeAttribute.TypeCharacteristics.IsBackwardEdge)
{
return true;
}
else if (workingTypeAttribute.GetDBType(typeManager).IsUserDefined)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
开发者ID:TheByte,项目名称:sones,代码行数:25,代码来源:SimplePathFunc.cs
注:本文中的IObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论